pyaudio

PyAudio Input overflowed

南笙酒味 提交于 2019-12-17 07:27:26
问题 I'm trying to make real-time plotting sound in python. I need to get chunks from my microphone. Using PyAudio, try to use import pyaudio import wave import sys chunk = 1024 FORMAT = pyaudio.paInt16 CHANNELS = 1 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" all = [] for i in range(0, RATE / chunk * RECORD_SECONDS): data =

Detect tap with pyaudio from live mic

99封情书 提交于 2019-12-17 04:46:08
问题 How would I use pyaudio to detect a sudden tapping noise from a live microphone? 回答1: One way I've done it: read a block of samples at a time, say 0.05 seconds worth compute the RMS amplitude of the block (square root of the average of the squares of the individual samples) if the block's RMS amplitude is greater than a threshold, it's a "noisy block" else it's a "quiet block" a sudden tap would be a quiet block followed by a small number of noisy blocks followed by a quiet block if you never

Python multiprocessing, PyAudio, and wxPython

若如初见. 提交于 2019-12-14 00:41:28
问题 I have a wxPython GUI, and would like to use multiprocessing to create a separate process which uses PyAudio. That is, I want to use PyAudio, wxPython, and the multiprocessing module, but although I can use any two of these, I can't use all three together. Specifically, if from one file I import wx, and create a multiprocessing.Process which opens PyAudio, PyAudio won't open. Here's an example: file: A.py import wx import time use_multiprocessing = True if use_multiprocessing: from

Analyzing Audio Level In Real Time using Python

让人想犯罪 __ 提交于 2019-12-13 07:28:15
问题 Im trying to get my Raspberry do stuff, based on the audio level of a played song (sound output). The song shouldn't neccessarily be a local mp3 file on the Raspberry. Let me explain it like this: If (audio level above threshold): do something.. I've found this http://freshfoo.com/posts/pulseaudio_monitoring/ which is pretty much what im looking for i guess, but i have to be able, reading single samples in order to compare it with thresholds ill be using. Analyze audio using Fast Fourier

Python Pyaudio — How to play a file streamed via HTTP

﹥>﹥吖頭↗ 提交于 2019-12-13 05:35:50
问题 I am trying to figure out how to play an mp3 that exists on my server served through HTTP. I tried to figure out pyglet but there were too many issues with AVBin to make that work (something about dividing by zero in the source code). So, I decided to try PyAudio, but I can't figure out how to stream an mp3 source from HTTP with it. All the examples are wav files and I need examples rather than the docs or I'm afraid I'll have to figure out the particulars of how audio works on the lowest

Running pyfluidsynth + pyaudio demo, many problems with alsa and jack

半世苍凉 提交于 2019-12-13 05:32:16
问题 I'm following the demo here. I'm very new to creating audio via python, so I'm not sure how to debug which errors I should consider, what naive things I might be doing wrong. Here are my python errors: >>> import time >>> import numpy >>> import pyaudio >>> import fluidsynth >>> >>> pa = pyaudio.PyAudio() ALSA lib pcm_dmix.c:1018:(snd_pcm_dmix_open) unable to open slave ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown

Please build and install the PortAudio Python bindings first

心不动则不痛 提交于 2019-12-13 02:58:32
问题 i already installed pyaudio but the problem is when i work with the microphone functions import speech_recognition as sr r = sr.Recognizer() mic = sr.Microphone() the problem is in the third line mic = sr.Microphone() the terminal will give me this message Please build and install the PortAudio Python bindings first. and if i try to install pip install PortAudio it will give me the following message Could not find a version that satisfies the requirement PortAudio (from versions: )No matching

PyAudio Play multiple sounds at once

做~自己de王妃 提交于 2019-12-12 20:47:52
问题 How can I mix two sounds with PyAudio into one. I browsed all over internet but nobody answered this question. I was also thinking about using audiolab or swMixer, but they dont support Python 3.4... I was thinking about converting they byte string into numpy array, merging it with another, and converting back to by string. Is that possible? wf1 = wave.open("YYY.wav", 'rb') wf1 = wave.open("XXX.wav", 'rb') p = pyaudio.PyAudio() def callback(in_data, frame_count, time_info, status): data1 =

PyAudio IOError: [Errno Invalid input device (no default output device)] -9996

懵懂的女人 提交于 2019-12-12 13:03:30
问题 I am attempting to run a simple python file that uses pyaudio to record input. However whenever I run this file I end up with this error. I had it working once and I have no idea what changed. I have tried import pyaudio pa = pyaudio.PyAudio() print(pa.get_device_count()) 0 So I am seeing that it does not detect any valid devices. Is there anyway to specify to pyaudio/portaudio where to look for my input devices. I am running elementary os freya. Any help would be appreciated! 回答1: Silly as

Continuesly streaming audio signal real time infinitely, Python

我只是一个虾纸丫 提交于 2019-12-12 10:14:56
问题 I have a simple question, while streaming audio signal from audio jack in Python, using pyaudio library how can I keep streaming the audio signal until I choose to "stop" the program. Example: The way we capture our web camera frames infinitely under a infinite while loop. For example: In this code(take from link)that records the stream just for 5 seconds what will be the modification that will serve my purpose import pyaudio import wave import numpy as np CHUNK = 44100 FORMAT = pyaudio