简体   繁体   中英

build pyaudio with portaudio with ASIO support

I'm running Python 2.7.3 [MSC v.1500 32 bit (Intel)] on win32.

I need to build portaudio with ASIO support and bind it to pyaudio to use it under Windows 7. Basically I want to access ASIO driver from python and I figured out this is the way. I'm following the manual from pyaudio webpage http://people.csail.mit.edu/hubert/pyaudio/ . The manual is rather outdated, gcc does not support -mno-cygwin flag any more. What I did:

  1. Download PyAudio-0.2.7 from their webpage
  2. Download the stable portaudio-v19 http://www.portaudio.com/download.html
  3. Dropped the "-mno-cygwin" options from the manual and compiled the portaudio (gcc version 4.5.3)
  4. Edited C:\\Python27\\Lib\\distutils\\cygwinccompiler.py and removed "-mno-cygwin" flag from the file.
  5. I ran the suggested pyaudio compilation but I'm getting a gcc error

     $ ../Python27/python.exe setup.py build --static-link -cmingw32 running build running build_py creating build creating build\\lib.win32-2.7 copying src\\pyaudio.py -> build\\lib.win32-2.7 running build_ext building '_portaudio' extension creating build\\temp.win32-2.7 creating build\\temp.win32-2.7\\Release creating build\\temp.win32-2.7\\Release\\src C:\\MinGW\\bin\\gcc.exe -mdll -O -Wall -I./portaudio-v19\\include/ -Ic:\\Python27\\inc lude -Ic:\\Python27\\PC -c src/_portaudiomodule.c -o build\\temp.win32-2.7\\Release\\ src\\_portaudiomodule.o -fno-strict-aliasing writing build\\temp.win32-2.7\\Release\\src\\_portaudio.def C:\\MinGW\\bin\\gcc.exe -shared -s build\\temp.win32-2.7\\Release\\src\\_portaudiomodul eo build\\temp.win32-2.7\\Release\\src\\_portaudio.def -Lc:\\Python27\\libs -Lc:\\Pyth on27\\PCbuild -lwinmm -lpython27 -lmsvcr90 -o build\\lib.win32-2.7\\_portaudio.pyd ./portaudio-v19\\lib/.libs/libportaudio.a -lwinmm gcc: error: ./portaudio-v19\\lib/.libs/libportaudio.a: No such file or directory error: command 'gcc' failed with exit status 1 

I assume the portaudio compilation failed. I think the mentioned libportaudio.a is a linux file. Can you tell what went wrong?

But the file from http://www.lfd.uci.edu/~gohlke/pythonlibs/ does not support ASIO unfortunately. To get ASIO support you also need to get the ASIO SDK. I managed to get it to compile with visual studio 2010 x64, but still trying to figure out how to make it use ASIO in practice (output is still only 2 channels when there should be 4-8 my card

It's because the file is actually called libportaudio.dll.a after being compiled on windows, but even renaming it doesn't sort the problem. Much easier to just download and install the binary from http://www.lfd.uci.edu/~gohlke/pythonlibs/

Installing pyaudio to work with cygwin's python is another matter, that's the problem I'm having.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM