Author Topic: (SOLVED)Is There a Manner to Play a Sound CrossPlatform With a Free Library???  (Read 1350 times)


  • Full Member
  • ***
  • Posts: 110
    • FaSasoftware
Is There a Manner to Play a Sound CrossPlatform With a Free Library???

i have tested all the lazarus library in the site...but nothing works here...i need a cross platform sound library that works...for my projects...
I have a macos x 10.13.6, 16gb ram, 1tb hard disk ssd,intel i3 imac....but i have also an Asus with 8 gb ram amd10 , 1tb hard disk ssd...
does exist a free solution??? can somebody help me??
I thank you a lot in advance....
Lestroso :'( :'( :'(
« Last Edit: May 07, 2019, 07:50:46 pm by lestroso »


  • Sr. Member
  • ****
  • Posts: 408
I used PortAudio before. It works cross platform.

It works with a callback function that is called by PortAudio sequently and you have to provide the current audio data through parameters. This means PortAudio doesn't open sound files, you have to take care of it seperately, but it also means you have full control of the played sound.


Edit: I used it on Windows.


  • Full Member
  • ***
  • Posts: 110
    • FaSasoftware
thank you...kupferstecher...

i tryed but nothing works here....the system is thery complicated.....or can you show me an your example to use use it??please?? thanks a lot...



  • Hero Member
  • *****
  • Posts: 3454
Not exactly the best (or more elegant) way, but there's a simple one that should work on most systems in the wiki: Play Sound Multiplatform.

It invokes mmsystem.sndPlaySound() for Windows and, for Linux, it searchs for one of several known players and, if found, calls it through a TAsyncProcess. I guess something similar might be done for *BSD and (Darwin) MacOS.

Otherwise, you can start reading at Multimedia Programming and go from there.

Oh, also check out this post: Recomendations for audio metadata. I asked about sound metadata but most library recommendations included ways to play the sounds, too.
« Last Edit: May 07, 2019, 12:36:57 am by lucamar »
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.10/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.


  • Full Member
  • ***
  • Posts: 110
    • FaSasoftware
Dear Lucamar,dear kupferstecher, dear all friends...

I'm sorry for this question....perhaps i have missed this option library...You have solved my problem!!! I thank to you! to everybody.... Definetly the best solution to add some sounds in our projects!!!
The link below is the right solution to every body...Play Sound Multiplatform

I have tested many formats!!! Works well in my Imac 2010....The formats that works fine with this library are:
WAV,AIFF,MP3,M4A,FLAC.....The formats that don't works with this library are OGG and WMA....
But...i'm very happy for this...i need mp3 the right compression!!!It  Works....

The only thing that i had to do was add the audio component  and rebuild Lazarus....It's all ok!!!

There are no words to thank you again....

Best regards,
Lestroso :D :D :D :D
« Last Edit: May 07, 2019, 07:51:41 pm by lestroso »


TinyPortal © 2005-2018