TPlaySound

This is an old revision of TPlaySound, edited by СМ630 at . The current revision is 101912.

/* Usage */

TPlaySound is a component to play WAV files in Windows and Linux.

playsound_oi.png
playsound_oi.png

Usage

procedure TfrmMain.FormCreate(Sender: TObject);
begin
...
  playsound1.PlayCommand :=
    {$ifdef windows}'sndPlaySound'{$endif};
    {$ifdef linux}'aplay -q'      {$endif};
    {$ifdef darwin}'afplay'       {$endif}; //There is no statement that TPlaySound works on MAC, but at least it will not create an exception.
...
end;
  playsound1.execute;

Download

I can also be installed directly from the Lazarus IDE: Main Menu — Package — Online Package Manager — PlaysoundPackage.

See Also