Recent

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

lestroso

  • Jr. Member
  • **
  • Posts: 95
    • 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 »

kupferstecher

  • Sr. Member
  • ****
  • Posts: 294
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.

Regards~

Edit: I used it on Windows.

lestroso

  • Jr. Member
  • **
  • Posts: 95
    • 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...

Lestroso

lucamar

  • Hero Member
  • *****
  • Posts: 2018
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 2.0.2/2.0.4  - FPC 3.0.4 on:
(K|L)Ubuntu 12..16, Windows XP SP3, various DOSes.

lestroso

  • Jr. Member
  • **
  • Posts: 95
    • 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
http://wiki.freepascal.org/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
https://www.fasasoftware.com
« Last Edit: May 07, 2019, 07:51:41 pm by lestroso »