PortAudio for PB
Re: PortAudio for PB
There is no more Misc2 library, the user lib you try to use is too old.
- Blue Steel
- Enthusiast
- Posts: 132
- Joined: Wed Aug 31, 2005 4:49 pm
- Contact:
Re: PortAudio for PB
Thanks.. i've now found the newer release of his library
Currently using PureBasic 4.51(x86)
http://www.codingmonkeys.com
Covers many languages including PureBasic

Covers many languages including PureBasic
Re: PortAudio for PB
I wrote a lightweight recording program using PortAudio which I haven't touched since May 2008. It writes the audio data directly to a RAM buffer which the user then saves to disk. I can dust off the cobwebs and make it available if there is one scintilla of interest in it.
I tried to compile PortAudio to a DLL as freak did but I am no expert on C compilers so I never had any success with it, and the people on the PortAudio mailing list were NOT helpful AT ALL! I'm glad to see it has been updated.
I tried to compile PortAudio to a DLL as freak did but I am no expert on C compilers so I never had any success with it, and the people on the PortAudio mailing list were NOT helpful AT ALL! I'm glad to see it has been updated.
Re: PortAudio for PB
Here you can find my x86/x64 dll (vc2008 compiled) ready to be used with PB (included with my modified PB include with ASIO support).
Re: PortAudio for PB
Very nice job of ASIO support. Any plans to implement WASAPI?KarLKoX wrote:Here you can find my x86/x64 dll (vc2008 compiled) ready to be used with PB (included with my modified PB include with ASIO support).
Re: PortAudio for PB
How did you manage to get it so small?KarLKoX wrote:Here you can find my x86/x64 dll (vc2008 compiled) ready to be used with PB (included with my modified PB include with ASIO support).
Re: PortAudio for PB
How did you manage to get portaudio to compile at all under Visual C++ 2008 Express Edition? It is a jumble of files and I can't get anything to compile without dozens of error messages.Trond wrote:How did you manage to get it so small?KarLKoX wrote:Here you can find my x86/x64 dll (vc2008 compiled) ready to be used with PB (included with my modified PB include with ASIO support).
Re: PortAudio for PB
1. Extract portaudio_snapshot.tgz into a new directory.chris319 wrote:How did you manage to get portaudio to compile at all under Visual C++ 2008 Express Edition? It is a jumble of files and I can't get anything to compile without dozens of error messages.Trond wrote:How did you manage to get it so small?KarLKoX wrote:Here you can find my x86/x64 dll (vc2008 compiled) ready to be used with PB (included with my modified PB include with ASIO support).
2. Get the ASIO sdk from Steinberg and copy the entire ASIOSDK2 folder into portaudio\src\hostapi\asio\. Rename it from ASIOSDK2 to simply ASIOSDK
3. Open the file build\msvc\portaudio.sln with VC++ Express
4. Click "Finish" in the wizard.
5. Open Project -> Portaudio properties, select "configuration properties" in the treeview and then "all configurations" in the combobox above.
6. Set a few options:
C/C++ -> Optimizations -> Omit frame pointers = Yes
C/C++ -> Code Generations -> Struct member alignment = 1
C/C++ -> Code Generations -> Runtime library = /MT
C/C++ -> Code Generations -> Floating point model = fast
Click "Ok".
7. Select "Release" (instead of "Debug") in the main toolbar.
8. Build -> Build solution
Re: PortAudio for PB
Thank you very much for that. I also had to download the DirectX SDK to get dsound.h and dsconf.h which go in portaudio\include and dsound.lib which goes in C:\Program Files\Microsoft SDKs\Windows\v6.0A\Lib.Trond wrote:1. Extract portaudio_snapshot.tgz into a new directory.
2. Get the ASIO sdk from Steinberg and copy the entire ASIOSDK2 folder into portaudio\src\hostapi\asio\. Rename it from ASIOSDK2 to simply ASIOSDK
3. Open the file build\msvc\portaudio.sln with VC++ Express
4. Click "Finish" in the wizard.
5. Open Project -> Portaudio properties, select "configuration properties" in the treeview and then "all configurations" in the combobox above.
6. Set a few options:
C/C++ -> Optimizations -> Omit frame pointers = Yes
C/C++ -> Code Generations -> Struct member alignment = 1
C/C++ -> Code Generations -> Runtime library = /MT
C/C++ -> Code Generations -> Floating point model = fast
Click "Ok".
7. Select "Release" (instead of "Debug") in the main toolbar.
8. Build -> Build solution
Re: PortAudio for PB
Still no joy with WASAPI:
Must be a PortAudio thing?
PortAudio.pb should be updated, adding a 14th API. Also note that MME is now 0, ASIO is now 2 and "skeleton implementation" is now 3.
Code: Select all
XIncludeFile "PortAudio.pb"
Pa_Initialize()
#NUM_API = 15
Dim api$(#NUM_API)
*my_api.PaHostApiInfo ;SET UP A STRUCTURE
For ct = 0 To #NUM_API - 1
*my_api = Pa_GetHostApiInfo(ct)
If *my_api > 0
api$(ct) = PeekS(*my_api\name)
EndIf
If api$(ct) = "": api$(ct) = "Not supported": EndIf
Debug(api$(ct) + " " + Str(ct))
Next
Pa_Terminate()
PortAudio.pb should be updated, adding a 14th API. Also note that MME is now 0, ASIO is now 2 and "skeleton implementation" is now 3.
Code: Select all
Enumeration ; PaHostApiTypeId
#paMME=0
#paWindowsDirectSound=1
#paASIO=2
#paSkeletonImplementation=3 ; /* use while developing support for a new host API */
#paSoundManager=4
#paCoreAudio=5
#paOSS=7
#paALSA=8
#paAL=9
#paBeOS=10
#paWDMKS=11
#paJACK=12
#paWASAPI=13
#paAudioScienceHPI=14
EndEnumeration
Re: PortAudio for PB
I tried wasapi. but I can use Waveout and directSound only.
ASIO2 is sucesss setup, however it didn't sound.
ASIO2 is sucesss setup, however it didn't sound.
Re: PortAudio for PB
ASIO works fine here.
Re: PortAudio for PB
There is now a version of PortAudio which supports WASAPI and works with PureBasic thanks to Dmitry Kostjuchenko, who works extensively with PortAudio. Send me a private message if you want the pertinent files.
Re: PortAudio for PB
Update:
I have been working with Dmitry and he advises me that when compiling the dll and the lib, the following setting:
should be 4 bytes instead of 1.
I have been working with Dmitry and he advises me that when compiling the dll and the lib, the following setting:
Code: Select all
C/C++ -> Code Generation -> Struct member alignment = 1
Re: PortAudio for PB
That will make the structs in the PB include file not work... I set it to 1 for a reason. You need to change the include file if you use 4.chris319 wrote:Update:
I have been working with Dmitry and he advises me that when compiling the dll and the lib, the following setting:
should be 4 bytes instead of 1.Code: Select all
C/C++ -> Code Generation -> Struct member alignment = 1