[fpc-pascal] playing sound files (linux and windows)

Alexander Grau alex at grauonline.de
Mon Jun 14 16:26:10 CEST 2010


Graeme Geldenhuys schrieb:
> Hi,
>
> Has anybody managed to play sound files under both Linux and Windows?
> Does FPC have a cross-platform API or FCL class for this?
>
> If so, what sound format's are supported?  ogg, wav, mp3?
>
>   
We have developed some kind of API to play a .wav file on both Windows 
and Mac.  The Windows version is easy (below), the Mac version is long 
(400 lines).

If someone would like to add a PlaySoundFile API to LCL/FPC, drop me a 
note and we will donate the Mac code for it :-) ...

Regards,
Alexander


uses windows, mmsystem;

procedure PlaySoundFile(filename: string);
begin
  PlaySound(pchar(filename), 0, SND_FILENAME + SND_ASYNC);
end;





More information about the fpc-pascal mailing list