Page 2 of 6

Re: PortAudio for PB

Posted: Fri Jan 22, 2010 9:52 am
by Fred
There is no more Misc2 library, the user lib you try to use is too old.

Re: PortAudio for PB

Posted: Fri Jan 22, 2010 11:27 am
by Blue Steel
Thanks.. i've now found the newer release of his library

Re: PortAudio for PB

Posted: Sat Jan 30, 2010 10:14 pm
by chris319
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.

Re: PortAudio for PB

Posted: Sun Jan 31, 2010 1:22 am
by KarLKoX
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

Posted: Sun Jan 31, 2010 8:20 am
by chris319
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).
Very nice job of ASIO support. Any plans to implement WASAPI?

Re: PortAudio for PB

Posted: Sun Jan 31, 2010 1:41 pm
by Trond
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?

Re: PortAudio for PB

Posted: Sun Jan 31, 2010 4:37 pm
by chris319
Trond wrote:
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?
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.

Re: PortAudio for PB

Posted: Sun Jan 31, 2010 5:41 pm
by Trond
chris319 wrote:
Trond wrote:
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?
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.
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

Posted: Sun Jan 31, 2010 10:15 pm
by chris319
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
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.

Re: PortAudio for PB

Posted: Mon Feb 01, 2010 12:05 am
by chris319
Still no joy with WASAPI:

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()
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

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

Posted: Mon Feb 01, 2010 2:11 pm
by oryaaaaa
I tried wasapi. but I can use Waveout and directSound only.
ASIO2 is sucesss setup, however it didn't sound.

Re: PortAudio for PB

Posted: Mon Feb 01, 2010 6:57 pm
by chris319
ASIO works fine here.

Re: PortAudio for PB

Posted: Thu Feb 04, 2010 10:15 pm
by chris319
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

Posted: Thu Mar 11, 2010 10:33 am
by chris319
Update:

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
should be 4 bytes instead of 1.

Re: PortAudio for PB

Posted: Thu Mar 11, 2010 2:41 pm
by Trond
chris319 wrote:Update:

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
should be 4 bytes instead of 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.