pyaudio

PyAudio ErrNo Input Overflowed -9981

為{幸葍}努か 提交于 2019-12-06 22:30:34
问题 I was getting the same error as the user in Python, Error audio Recording in 16000Hz using Pyaudio The error was the same (except for the line numbers) as in the below graphic: As I was writing this, I found the solution to my problem in this link. The solution was to up the bitrate to 48000. But I had already "been approved" at 44100 if p.is_format_supported(44100.0, # Sample rate input_device=devinfo["index"], input_channels=devinfo['maxInputChannels'], input_format=pyaudio.paInt16): print

how to convert wav to mp3 in live using python?

六月ゝ 毕业季﹏ 提交于 2019-12-06 19:14:00
问题 I have code like what is shown below to get audio from microphone: import pyaudio p = pyaudio.PyAudio() CHUNK = 1024 FORMAT = pyaudio.paInt16 CHANNELS = 2 RATE = 1024*10 RECORD_SECONDS = 10 stream = p.open(format=FORMAT, channels=CHANNELS, rate=RATE, input=True, frames_per_buffer=CHUNK) for i in range(0, int(RATE / CHUNK * RECORD_SECONDS)): data = stream.read(CHUNK) send_via_socket(data) # function to send each frame to remote system This code is working fine. However each data frame has a

Special characters in audio devices name : Pyaudio

天涯浪子 提交于 2019-12-06 10:33:51
I'm currently facing a hard problem. I need to use Pyaudio on a french windows environnement and the name of the audio devices contains é or è by default. This is the error I get when a special character is present: u=self.p.get_device_info_by_index(e) File "C:\Python27\lib\site-packages\pyaudio.py", line 977, in get_device_info_ by_index pa.get_device_info(device_index) File "C:\Python27\lib\site-packages\pyaudio.py", line 987, in _make_device_inf o_dictionary print device_info.name UnicodeDecodeError: 'utf8' codec can't decode byte 0xe9 in position 13: invalid continuation byte This wouldn't

Building PortAudio and PyAudio on Mac running Snow Leopard (arch issues)

孤街浪徒 提交于 2019-12-06 05:43:46
问题 I'd like to tell you what I've tried and then I'd really welcome any comments you can provide on how I can get PortAudio and PyAudio setup correctly! I've tried installing the stable and svn releases of PortAudio from their website for my Core 2 Duo MacBook Pro running Snow Leopard. The stable release has a sizeof error that can be fixed(?), but the daily svn release installs fine with ./configure && make && make install (so this is what I'm using). The tests are compiled properly and I can

Prevent ALSA underruns with PyAudio

风流意气都作罢 提交于 2019-12-05 21:47:42
I wrote a little program which records voice from the microphone and sends it over network and plays it there. I'm using PyAudio for this task. It works almost fine but on both computers i get errors from ALSA that an underrun occurred. I googled a lot about it and now I know what an underrun even is. But I still don't know how to fix the problem. Most of the time the sound is just fine. But it sounds a little bit strange if underruns occur. Is there anything I should take care of in my code? It feels like I'm doing an simple error and I miss it. My system: python: python3.3, OS: Linux Mint

Getting IOError: [Errno Input overflowed] -9981 when setting PyAudio Stream input and output to True

醉酒当歌 提交于 2019-12-05 19:15:22
问题 I'm trying to run the following code (an example from the PyAudio documentation) on my Mac (OS 10.7.2): import pyaudio import sys chunk = 1024 FORMAT = pyaudio.paInt16 CHANNELS = 1 RATE = 44100 RECORD_SECONDS = 5 p = pyaudio.PyAudio() stream = p.open(format = FORMAT, channels = CHANNELS, rate = RATE, input = True, output = True, frames_per_buffer = chunk) print "* recording" for i in range(0, 44100 / chunk * RECORD_SECONDS): data = stream.read(chunk) stream.write(data, chunk) print "* done"

install pyaudio with macOs Sierra

随声附和 提交于 2019-12-05 17:37:31
I upgraded my Mac to macOS Sierra and I had to start a new account. Right now I am trying to establish my environment. I ran into a problem installing pyaudio. The procedure I used is first use homebrew and install port audio. brew install portaudio It installs with no errors. I proceed to install pyaudio using pip pip install pyaudio I receive the following error message. cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv

Having trouble installing PyAudio for Python3 on Mint

我们两清 提交于 2019-12-05 06:27:08
I was following the instructions here and I'm having trouble getting the installation to work. Basically, the first part works fine. I downloaded portaudio, followed the instructions, and it all seemed to work. However, when I tried python3 setup.py install , I got an error. The error came from the /src/_portaudiomodule.c file, and it said that "The file Python.h could not be found". I don't really understand what's going on because there was no Python.h file when I extracted the PyAudio archive. I don't know where the Python.h file was supposed to come from. I'm kind of a noob to unix systems

how to convert wav to mp3 in live using python?

若如初见. 提交于 2019-12-05 00:46:07
I have code like what is shown below to get audio from microphone: import pyaudio p = pyaudio.PyAudio() CHUNK = 1024 FORMAT = pyaudio.paInt16 CHANNELS = 2 RATE = 1024*10 RECORD_SECONDS = 10 stream = p.open(format=FORMAT, channels=CHANNELS, rate=RATE, input=True, frames_per_buffer=CHUNK) for i in range(0, int(RATE / CHUNK * RECORD_SECONDS)): data = stream.read(CHUNK) send_via_socket(data) # function to send each frame to remote system This code is working fine. However each data frame has a size of 4kb. That means 40kb of internet data is needed to send 1 sec of audio data. It's only 6kb of

Python, Error audio Recording in 16000Hz using Pyaudio

余生颓废 提交于 2019-12-04 22:07:28
问题 I use Python 2.7.3, Mac OS 10.8.2 and Xcode 4.5.1 I am trying to record sound using PyAudio following the instructions in http://people.csail.mit.edu/hubert/pyaudio/ and using the program """PyAudio example: Record a few seconds of audio and save to a WAVE file.""" import pyaudio import wave CHUNK = 1024 FORMAT = pyaudio.paInt16 CHANNELS = 2 RATE = 44100 RECORD_SECONDS = 5 WAVE_OUTPUT_FILENAME = "output.wav" p = pyaudio.PyAudio() stream = p.open(format=FORMAT, channels=CHANNELS, rate=RATE,