pyaudio

How to process audio stream in realtime

为君一笑 提交于 2019-12-25 08:36:48
问题 I have a setup with a raspberry pi 3 running latest jessie with all updates installed in which i provide a A2DP bluetooth sink where i connect with a phone to play some music. Via pulseaudio, the source (phone) is routed to the alsa output (sink). This works reasonably well. I now want to analyze the audio stream using python3.4 with librosa and i found a promising example using pyaudio which got adjusted to use the pulseaudio input (which magically works because its the default) instead of a

Can't install PyAudio on GAE Flexible Environment(Python)

筅森魡賤 提交于 2019-12-25 02:10:49
问题 So I am having quite a few issues getting this flask backend up. It is pretty standard stuff apart from some logic that recognizes audio delivered from the frontend. To do this, I incorporate PyDejaVu. One of the dependencies(PyAudio) is not building correctly. Everything else is good to go. Here are some logs: Step #1: #include "portaudio.h" Step #1: ^ Step #1: compilation terminated. Step #1: error: command 'x86_64-linux-gnu-gcc' failed with exit status 1 Step #1: Failed building wheel for

PyAudio callback being called only once

纵饮孤独 提交于 2019-12-24 11:08:35
问题 I'm trying to create a simple app that loads wav files (one for each note of a keyboard) and plays specific ones when a midi note is pressed (or played). So far, I've created a midi input stream using mido and an audio stream using pyaudio in two separate threads. the goal is for the midi stream to update the currently playing notes, and the callback of the pyaudio stream to check for active notes and play those that are. The midi stream works fine, but my audio stream only seems to call the

Pyaudio: Error when wiring input to output

谁说我不能喝 提交于 2019-12-24 03:53:16
问题 I'm trying out pyaudio on Intel Edison board, but it fails with the build-in tests. Recording and playing alone works fine with my setting, but if I'm trying to wire input to output, it gives an error. File "wire_full.py", line 33, in data = stream.read(CHUNK) File "/usr/lib/python2.7/site-packages/pyaudio.py", line 605, in read return pa.read_stream(self._stream, num_frames) IOError: [Errno Input overflowed] -9981 Does anybody understand what's the problem? Below is the example code for

PyAudio : AttributeError: 'module' object has no attribute 'PyAudio'

╄→гoц情女王★ 提交于 2019-12-24 02:44:18
问题 Today I installed Pyaudio by using instruction on http://people.csail.mit.edu/hubert/pyaudio/ and trying to run some examples like this one. 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, input=True, frames_per_buffer=CHUNK) print("* recording") frames = [] for i in range(0, int(RATE / CHUNK * RECORD_SECONDS)):

Value Error occurs when filtering wav file

随声附和 提交于 2019-12-23 23:01:58
问题 We are currently integrating three codes 1. Mic recorder 2. Integrator (Low-Pass filtering) 3. Applying the filter We encountered this error: fltrd() [[ 0 0] [ -1 0] [ 0 0] ..., [-65 -60] [-31 -52] [-45 -53]] Traceback (most recent call last): File "<ipython-input-2-72cbac6fd2ac>", line 1, in <module> fltrd() File "C:/Users/vsecadesang/Desktop/5th year/2nd sem/SIGNLAB/PROJECT/etc/project.py", line 57, in fltrd a2 = integ(x) File "C:/Users/vsecadesang/Desktop/5th year/2nd sem/SIGNLAB/PROJECT

PyAudio recorder script IOError: [Errno Input overflowed] -9981

五迷三道 提交于 2019-12-23 12:27:40
问题 The code below is what I use to record audio until the "Enter" key is pressed it returns an exception, import pyaudio import wave import curses from time import gmtime, strftime import sys, select, os # Name of sub-directory where WAVE files are placed current_experiment_path = os.path.dirname(os.path.realpath(__file__)) subdir_recording = '/recording/' # print current_experiment_path + subdir_recording # Variables for Pyaudio chunk = 1024 format = pyaudio.paInt16 channels = 2 rate = 48000 #

Getting IOError: [Errno Invalid number of channels] -9998 when using mic with PyAudio on Raspberry Pi

流过昼夜 提交于 2019-12-23 04:28:55
问题 Bad news, everyone! I try to use a microphone on my Raspberry Pi through PyAudio but without success. The microphone is connected to a USB sound card. The microphone works when I go through 'arecord' : pi@raspberrypi ~ $ arecord -D plughw:0,0 -f cd test2.wav Recording WAVE 'test2.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo However, when I do the test record.py in PyAudio, I got an error. The error is the same for all programs in Python that uses PyAudio : pi@raspberrypi /usr/src

install pyaudio with macOs Sierra

落花浮王杯 提交于 2019-12-22 08:05:44
问题 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

Loopback ('What u hear') recording in Python using PyAudio

二次信任 提交于 2019-12-21 17:49:47
问题 Good day, I'm trying to record my speaker output with Python using PyAudio. Currently, I'm able to record my microphone input and send this over to the 'listener'. What I'm trying to do now is create a loopback, so it will record the output from my speakers. I was able to do this with the 'Stereo Mix' from windows, but since this needs to be cross platform, there should be another way to do this. Does anyone has some advice on how I could achieve this? Here is my current code for recording an