pyaudio

PyAudio working, but spits out error messages each time

拥有回忆 提交于 2020-01-08 10:23:12
问题 I'm using PyAudio to record input from the microphone. Since the audio is recording fine for me, should I try to simply suppress its error messages? Or would there be a way of resolving them? ALSA lib pcm.c:2212:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear ALSA lib pcm.c:2212:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe ALSA lib pcm.c:2212:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side ALSA lib audio/pcm_bluetooth.c:1613:(audioservice_expect) BT_GET_CAPABILITIES failed :

Recording or Playing Audio with Python not working on Mac: No Errors & No Sound

三世轮回 提交于 2020-01-06 06:54:39
问题 I'm trying to work with Audio on Python 3.7 on Mac(Catalina) only with the built-in Microphone and Speakers. My Problem is that with any code I tried, when recording I receive nothing and when playing sound nothing comes out. I tried the answers from this question: first I tried with PyAudio like this: 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

How to loop-play an audio with pyaudio?

試著忘記壹切 提交于 2020-01-06 06:05:28
问题 I want to play an audio wave file using Pyaudio and tkinter where the audio plays when the button is pressed and the audio stops when the stop button is pressed. Now, the audio is a simple 5 secs wave file, as it is suppose to, the audio stops after 5 secs. I would like to know how to loop it, such that the audio keeps on playing forever unless the stop button is clicked. I cannot find a way with this code. from tkinter import * import pyaudio import wave import sys import threading # ---

How to loop-play an audio with pyaudio?

瘦欲@ 提交于 2020-01-06 06:05:28
问题 I want to play an audio wave file using Pyaudio and tkinter where the audio plays when the button is pressed and the audio stops when the stop button is pressed. Now, the audio is a simple 5 secs wave file, as it is suppose to, the audio stops after 5 secs. I would like to know how to loop it, such that the audio keeps on playing forever unless the stop button is clicked. I cannot find a way with this code. from tkinter import * import pyaudio import wave import sys import threading # ---

How to concatenate sine waves without phase jumps

为君一笑 提交于 2020-01-04 01:56:54
问题 I need to make a python script which generates sine waves of a given frequency and plays them using pyaudio (blocking mode), I also need to be able to change this frequency while it runs, modulate it and plot it using pyqtgraph. For now I have a thread generating chunks of data and my approach to 'connect' those sines was to get the fft and then calculate the angle (numpy.angle), store it in a variable and use it as the phase offset to the next chunk, but I'm not getting the results I

PyAudio Memory Error

亡梦爱人 提交于 2020-01-01 16:05:53
问题 I am having an issue with my code which causes a memory error. I believe it is caused by this function (see below). def sendAudio(): p = pyaudio.PyAudio() stream = p.open(format = FORMAT, channels = CHANNELS, rate = RATE, input = True, output = True, frames_per_buffer = chunk) data = stream.read(chunk) client(chr(CMD_AUDIO), encrypt_my_audio_message(data)) def keypress(event): if event.keysym == 'Escape': root.destroy() if event.keysym == 'Control_L': #print("Sending Data...") sendAudio()

Generating smooth audio from Python on a low-powered computer

假装没事ソ 提交于 2019-12-31 02:43:07
问题 I am trying to write a simple audio function generator in Python, to be run on a Raspberry Pi (model 2). The code essentially does this: Generate 1 second of the audio signal (say, a sine wave, or a square wave, etc) Play it repeatedly in a loop For example: import pyaudio from numpy import linspace,sin,pi,int16 def note(freq, len, amp=1, rate=44100): t = linspace(0,len,len*rate) data = sin(2*pi*freq*t)*amp return data.astype(int16) # two byte integers RATE = 44100 FREQ = 261.6 pa = pyaudio

PyAudio Input Overflowed -9981 - No solution working

a 夏天 提交于 2019-12-30 10:50:26
问题 Please do not report this question as a duplicate, because none of the already available Solution working for me, I tested them all So, I am trying to run a PyAudio sample Recording program in my RaspberryPi model B board, This is the error I am getting, Traceback (most recent call last): File "/home/pi/pyaudio/test/testing.py", line 23, in <module> data = stream.read(chunk) File "/usr/local/lib/python2.7/dist-packages/pyaudio.py", line 605, in read return pa.read_stream(self._stream, num

pyaudio installation on mac (python 3)

流过昼夜 提交于 2019-12-30 00:51:24
问题 I first tried: pip install pyaudio but I was told that -bash: pip: command not found Then I tried: pip3 install pyaudio then i got: src/_portaudiomodule.c:29:10: fatal error: 'portaudio.h' file not found #include "portaudio.h" ^ 1 error generated. error: command '/usr/bin/clang' failed with exit status 1 ---------------------------------------- Command "/Library/Frameworks/Python.framework/Versions/3.4/bin/python3.4 -c "import setuptools, tokenize;__file__='/private/var/folders/77

Python pocketsphinx RequestError: missing PocketSphinx module: ensure that PocketSphinx is set up correctly

故事扮演 提交于 2019-12-29 04:45:25
问题 I am trying to make a Python app that can record audio and translate it into english text using PyAudio, SpeechRecognition and PocketSphinx. I'm running on a Mac OS X El Capitan, version 10.11.2. Following a tutorial like this one and others, I've downloaded PyAudio version 0.2.9, SpeechRecognition as well as PocketSphinx. I've installed them into a Conda environment. I have followed the instructions from this site to use brew install swig git python on my OS X, hoping it would help. This is