portaudio

Time between callback calls?

旧城冷巷雨未停 提交于 2019-11-30 15:24:06
I have a lab project that uses mainly PyAudio and to further understand its way of working I made some measurements, in this case time between callbacks (using callback mode). I timed it, and got an interesting result (@256 chunk size, 44.1k fs): 0.0099701;0.0000365;0.0000201;0.0201579 This pattern goes on and on. Between two longer calls, we have two shorter calls and sometimes the longer call is shorter (mind you I don't do anything else in the program than time the callbacks) . If we average this out we get our desired callback time: 1/44100 * 256 (roughly 5.8ms) Here is my measurement

How do I get a list of my device's audio sample rates using PyAudio or PortAudio?

跟風遠走 提交于 2019-11-29 10:49:48
I'd like to query my audio device and get all its available sample rates. I'm using PyAudio 0.2, which runs on top of PortAudio v19, on an Ubuntu machine with Python 2.6. In the pyaudio distribution, test/system_info.py shows how to determine supported sample rates for devices. See the section that starts at line 49 . In short, you use the PyAudio.is_format_supported method, e.g. devinfo = p.get_device_info_by_index(1) # Or whatever device you care about. if p.is_format_supported(44100.0, # Sample rate input_device=devinfo['index'], input_channels=devinfo['maxInputChannels'], input_format

PyAudio IOError: No Default Input Device Available

帅比萌擦擦* 提交于 2019-11-29 02:56:58
I'm using PyAudio under the Enthought Python Distribution (Python 2.6.6) in Ubuntu 10.10 x64. >>> import pyaudio >>> pa = pyaudio.PyAudio() >>> pa.get_default_input_device_info() Traceback (most recent call last): File "<pyshell#24>", line 1, in <module> pa.get_default_input_device_info() File "/usr/lib/python_epd/lib/python2.6/site-packages/pyaudio.py", line 936, in get_default_input_device_info device_index = pa.get_default_input_device() IOError: No Default Input Device Available This is the same error I get if I try to open an input stream. There is the corresponding error "IOError: No

Python PyAudio installation problems (with PortAudio)

*爱你&永不变心* 提交于 2019-11-28 07:14:56
问题 I'm trying to write a program to record information from my computers microphone an save it to a file. PyAudio seems like one of the better packages for doing this, and they even have a binary for Windows 7 (Python 2.7). I downloaded the executable file and ran it to set up PyAudio, but when I try to import PyAudio into a python script now I get an error: Please build and install the PortAudio Python bindings first. Traceback (most recent call last): File "<pyshell#0>", line 1, in <module>

PyAudio IOError: No Default Input Device Available

[亡魂溺海] 提交于 2019-11-27 22:02:27
问题 I'm using PyAudio under the Enthought Python Distribution (Python 2.6.6) in Ubuntu 10.10 x64. >>> import pyaudio >>> pa = pyaudio.PyAudio() >>> pa.get_default_input_device_info() Traceback (most recent call last): File "<pyshell#24>", line 1, in <module> pa.get_default_input_device_info() File "/usr/lib/python_epd/lib/python2.6/site-packages/pyaudio.py", line 936, in get_default_input_device_info device_index = pa.get_default_input_device() IOError: No Default Input Device Available This is

How to extract frequency information from samples from PortAudio using FFTW in C

对着背影说爱祢 提交于 2019-11-27 18:36:52
I want to make a program that would record audio data using PortAudio (I have this part done) and then display the frequency information of that recorded audio (for now, I'd like to display the average frequency of each of the group of samples as they come in). From some research I've done, I know that I need to do an FFT. So I googled for a library to do that, in C, and found FFTW. However, now I am a little lost. What exactly am I supposed to do with the samples I recorded to extract some frequency information from them? What kind of FFT should I use (I assume I'd need a real data 1D?)? And

How to extract frequency information from samples from PortAudio using FFTW in C

北城余情 提交于 2019-11-26 19:31:11
问题 I want to make a program that would record audio data using PortAudio (I have this part done) and then display the frequency information of that recorded audio (for now, I'd like to display the average frequency of each of the group of samples as they come in). From some research I've done, I know that I need to do an FFT. So I googled for a library to do that, in C, and found FFTW. However, now I am a little lost. What exactly am I supposed to do with the samples I recorded to extract some

Python package installation issues: PyAudio, PortAudio

删除回忆录丶 提交于 2019-11-26 17:07:30
问题 I am having issues installing PyAudio and portaudio. When I do python -m pip install pyaudio I get this error: src/_portaudiomodule.c(29): fatal error C1083: Cannot open include file: 'portaudio.h': No such file or directory error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.14.26428\\bin\\HostX86\\x86\\cl.exe' failed with exit status 2 ---------------------------------------- Command ""C:\Users\This PC\AppData\Local\Programs\Python\Python37