Page 1 of 1

Hey, Do anyone no how to use PortAudio on Mac OS X

Posted: Tue Nov 22, 2016 11:49 pm
by dman10001
Im using a demo for PortAudio and libportaudio.2.0.0.dylib with Purebasic version 5.44 Beta.

The problem or the error is : Bad parameter type, number expected instead of string.
and the code in ProcedureReturn PeekS(*info\name)


The code is :

Code: Select all

Procedure.s Pa_PaHostApiIndexToString(Ind)
  *info.PaHostApiInfo = Pa_GetHostApiInfo(Ind)
   ProcedureReturn PeekS(*info\name)
EndProcedure

Procedure.s DeviceString(*dev.PaDeviceInfo)
  ProcedureReturn PeekS(*dev\name) + " " + Pa_PaHostApiIndexToString(*dev\hostApi)
EndProcedure
Is there anyone who know how to use PortAudio and show a simple demo to play mp3 files ?

Thank You.

Re: Hey, Do anyone no how to use PortAudio on Mac OS X

Posted: Wed Nov 23, 2016 7:24 am
by wilbert
I did use PortAudio in the past but not the specific function you are having problems with.
In general it's not that different from using PortAudio on Windows or Linux.

Maybe a silly question but is there any reason you want to use PortAudio.
The same things can usually be done much easier with platform specific code.

Re: Hey, Do anyone no how to use PortAudio on Mac OS X

Posted: Wed Nov 23, 2016 7:46 am
by dman10001
I just need to get the data to do visuals.

Re: Hey, Do anyone no how to use PortAudio on Mac OS X

Posted: Wed Nov 23, 2016 9:01 am
by wilbert
As far as I understand PortAudio doesn't have a MP3 decoder and is only for working with audio samples. :?
I don't know how you want to use it to play MP3 files.

Are you creating something cross platform or MacOS only ?

Re: Hey, Do anyone no how to use PortAudio on Mac OS X

Posted: Wed Nov 23, 2016 9:21 pm
by dman10001
Hi, the mixxx dj program I assumed they used port audio dll for mp3. http://www.mixxx.org

and check the website : http://www.portaudio.com

i need to decode mp3 files, is there a way I can do it myself using the mp3 format info ?
or I can just use a third party sdk dll ?

I know about the bass.dll, I do not want to use this.

is there an easier way to decode and play mp3 files on the mac using purebasic ?

Re: Hey, Do anyone no how to use PortAudio on Mac OS X

Posted: Thu Nov 24, 2016 7:35 am
by wilbert
OSX has a built in mp3 decoder.

The best approach depends on a few things.
- What's the minimum OSX version your application needs to work on.
- Do you need to decode the mp3 while streaming it or in advance.
- Do you need all sample data or is it enough to only have a volume meter while playing.

Re: Hey, Do anyone no how to use PortAudio on Mac OS X

Posted: Thu Nov 24, 2016 8:14 pm
by WilliamL
is there an easier way to decode and play mp3 files on the mac using purebasic ?

Code: Select all

Result = LoadMovie(#Movie, Filename$)
doesn't get any easier that that..

Re: Hey, Do anyone no how to use PortAudio on Mac OS X

Posted: Sat Nov 26, 2016 12:23 am
by dman10001
yeah thats easy, but I need to get the data values.
I found out that I can use the libmpeg123 DLL or DYLIB Windows and MAC respectively.
thanks for the help.

Re: Hey, Do anyone no how to use PortAudio on Mac OS X

Posted: Sat Nov 26, 2016 8:26 am
by wilbert
dman10001 wrote:yeah thats easy, but I need to get the data values.
I found out that I can use the libmpeg123 DLL or DYLIB Windows and MAC respectively.
If you don't want to use external libs, you can use the AudioToolbox framework on OSX.
How easy it would be to use AudioToolbox depends on your needs. Decoding of MP3 with constant bitrate in the original sample format is relatively easy.
Supporting VBR or converting all mp3 input files to the same sample rate (for example 44100 Hz stereo) would be a bit more difficult.