Recent

Author Topic: [SOLVED ][Mac OSX] Help me - How play audio file wav/mp3?  (Read 4121 times)

laguna

  • Sr. Member
  • ****
  • Posts: 323
[SOLVED ][Mac OSX] Help me - How play audio file wav/mp3?
« on: April 12, 2018, 10:13:02 am »
 How play audio file wav in Mac OSX?

without library external (no file .so);

Es. PlayAudioFile(namefile);

Thanks
Vincenzo
« Last Edit: April 18, 2018, 11:45:26 am by laguna »

Lulu

  • Full Member
  • ***
  • Posts: 226
Re: Help me - How play audio file wav in Mac OSX?
« Reply #1 on: April 13, 2018, 10:07:56 am »
Hello Laguna,

Maybe OALSoundManager will be able to meet your needs?
It uses OpenAL, which is, I think, installed natively on Mac.
Only 8 bits and 16 bits wav file are supported.

Dowload: https://github.com/Lulu04/OALSoundManager

Put it in your project folder and simply add:

Code: Pascal  [Select][+][-]
  1. // in your uses clause add:
  2.   OALSoundManager,  VelocityCurve;
  3.  
  4. // in variable declaration add for example:
  5.   FSound: TOALSound;
  6.  
  7. // in your code simply add:
  8.  FSound := OALManager.Add( MySoundFileName );  // initialize the sound from wav file
  9. ...
  10. // to play the sound
  11.  FSound.Play;
  12. ...
  13. // free the sound
  14. OALManager.Delete( FSound );
  15.  

In OALSoundManager folder, there is a demo that illustrates all the possibilities.
wishing you a nice life

laguna

  • Sr. Member
  • ****
  • Posts: 323
Re: Help me - How play audio file wav in Mac OSX?
« Reply #2 on: April 13, 2018, 12:24:06 pm »
I created the attached program for text translation for MAC OSX and audio playback.

The audio component works for wav files.

I made a small mistake.
The product file is not WAV but it is MP3.

Is there any way to play the audio file?

Thanks for all
Vincenzo

Lulu

  • Full Member
  • ***
  • Posts: 226
wishing you a nice life

laguna

  • Sr. Member
  • ****
  • Posts: 323
Re: Help me - How play audio file wav in Mac OSX?
« Reply #4 on: April 13, 2018, 06:09:11 pm »
Run is OK.

Thanks
Vincenzo



 

TinyPortal © 2005-2018