Re: PortAudio for PB
Posted: Fri Jan 22, 2010 9:52 am
There is no more Misc2 library, the user lib you try to use is too old.
http://www.purebasic.com
https://www.purebasic.fr/english/
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).
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).
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).
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).
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
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()
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
Code: Select all
C/C++ -> Code Generation -> Struct member alignment = 1
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