pyaudio

PyAudio (PortAudio issue) Python

試著忘記壹切 提交于 2019-12-11 06:55:20
问题 I installed pyaudio with anaconda python. Using conda install pyaudio on windows. It said it installed and it also installed PortAudio with it. However, when I create my file and run it now I get the following issue. I have no idea what is going on. Could not import the PyAudio C module '_portaudio'. Traceback (most recent call last): File "C:\Users\This PC\Desktop\Py\demo.py", line 2, in <module> import pyaudio File "C:\Users\This PC\Anaconda3\lib\site-packages\pyaudio.py", line 116, in

Is it possible to play two notes at once with pyaudio?

主宰稳场 提交于 2019-12-11 04:01:17
问题 Is it possible to play chords using pyaudio? 回答1: Of course! Just generate the result and pass it to the player. This article covers a method to do it. Here is the example code in case the article at the link changes or goes dead: import math import numpy import pyaudio import itertools from scipy import interpolate from operator import itemgetter # https://davywybiral.blogspot.com/2010/09/procedural-music-with-pyaudio-and-numpy.html class Note: NOTES = ['c','c#','d','d#','e','f','f#','g','g#

pyaudio: no sound recorded

回眸只為那壹抹淺笑 提交于 2019-12-11 00:35:34
问题 I have some problem using pyaudio. I am working on ubuntu 18.04 using python 3.6.7, pyaudio version 0.2.11 and have the following dependencies: libportaudiocpp0 portaudio19-dev libportaudio2-dev Basically I am running this: python import pyaudio import wave CHUNK = 2048*50 FORMAT = pyaudio.paInt16 CHANNELS = 2 RATE = 44100 RECORD_SECONDS = 3 WAVE_OUTPUT_FILENAME = "test.wav" p = pyaudio.PyAudio() info = p.get_host_api_info_by_index(0) numdevices = info.get('deviceCount') for i in range(0,

List devices with PyAudio on Linux

孤街醉人 提交于 2019-12-10 20:06:45
问题 When listing audio devices on Linux (I tried with Raspbian / RaspberryPi) with: import pyaudio p = pyaudio.PyAudio() for i in range(p.get_device_count()): print p.get_device_info_by_index(i) I get these errors. How to have a clean PyAudio running on Raspberry? ALSA lib confmisc.c:1286:(snd_func_refer) Unable to find definition 'cards.bcm2835.pcm.front.0:CARD=0' ALSA lib conf.c:4241:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory ALSA lib conf.c:4720:

Play the contents of a sound retrieved from an url?

独自空忆成欢 提交于 2019-12-10 20:01:07
问题 I am retrieving the sound from: http://translate.google.com/translate_tts and writing it to a WAV file, when i double-click the file the sound plays ok, but when i use the WAVE module from python to open it, it gives me this error: wave.Error: file does not start with RIFF id I want to know if there is a way for openning this file, or if it is possible to play the sound without writing it before. Here is the relevant code: url = "http://translate.google.com/translate_tts?tl=%s&q=%s" % (lang,

Entering a sequence of notes and have them played

喜夏-厌秋 提交于 2019-12-10 18:38:11
问题 My son and I are trying to write a program that will allow a user to input a sequence of musical notes, and save them into a list to be played back. We've come up with the following: import math #import needed modules import pyaudio #sudo apt-get install python-pyaudio def playnote(char): octave = int(char[1]) if char[0] == 'c': frequency = 16.35*octave+1 elif char[0] =='C': frequency = 17.32*octave+1 elif char[0] =='d': frequency = 18.35*octave+1 elif char[0] == 'D': frequency = 19.45*octave

Special characters in audio devices name : Pyaudio

北城以北 提交于 2019-12-10 10:42:49
问题 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

python pyaudio using multiprocessing

ⅰ亾dé卋堺 提交于 2019-12-09 18:38:34
问题 I'm trying to grab samples from a stream of audio and put them in a shared Queue. I have another process that pulls from this queue. When I run, I get this error: * recording Traceback (most recent call last): File "record.py", line 43, in <module> data = stream.read(CHUNK) File "/Library/Python/2.7/site-packages/pyaudio.py", line 605, in read return pa.read_stream(self._stream, num_frames) IOError: [Errno Input overflowed] -9981 EDIT: Apparently problem has been around for a while with no

How to capture audio in Raspberry Pi using Pyaudio python module without overflow?

丶灬走出姿态 提交于 2019-12-08 04:20:05
问题 The following code I tried to run it on Raspberry Pi 3 Model B which has a little big of capacity on it's memory, the problem that I'm facing with the code is that it runs sometimes: from os import environ, path import pyaudio from pocketsphinx.pocketsphinx import * from sphinxbase.sphinxbase import * MODELDIR = "../../../model" DATADIR = "../../../test/data" config = Decoder.default_config() config.set_string('-hmm', path.join(MODELDIR, 'en-us/en-us')) config.set_string('-lm', path.join

Having trouble installing PyAudio for Python3 on Mint

痞子三分冷 提交于 2019-12-07 03:30:46
问题 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