Questions tagged [pyaudio]

PyAudio provides Python bindings for PortAudio, the cross-platform audio I/O library.

PyAudio provides Python bindings for PortAudio, the cross-platform audio I/O library. With PyAudio, you can easily use Python to play and record audio streams on a variety of platforms (e.g. GNU/Linux, Microsoft Windows and Mac OS X).

Sources:

  1. http://pypi.python.org/pypi/PyAudio/
  2. http://people.csail.mit.edu/hubert/pyaudio/
1375 questions
4
votes
2 answers

Channels and Sample rates using python and pyaudio

I am trying to record and playback some audio using python and pyaudio. I am using a microphone connected to a raspberry pi with a C-Media Electronics, Inc. CM108 Audio Controller set as the default device. This device only records in mono. 0 -…
Richard
  • 41
  • 1
  • 1
  • 3
4
votes
1 answer

How to control a sound card programmatically?

I'm playing with pyaudio on a mac using a Saffire Pro 40 sound card. Currently I have two inputs plugged in and I'd like to control the levels of the second input channel programmatically. (This works fine using the sound card's mix control…
George Profenza
  • 50,687
  • 19
  • 144
  • 218
4
votes
3 answers

howto stream numpy array into pyaudio stream?

I'm writing a code that supposed to give some audio output to the user based on his action, and I want to generate the sound rather than having a fixed number of wav files to play. Now, what I'm doing is to generate the signal in numpy format, store…
Yotam
  • 10,295
  • 30
  • 88
  • 128
4
votes
4 answers

Pyaudio How to get sound on only one speaker

I'm using pyaudio in a school project and I'm trying to get the sound to play on only one speaker at a time. My code is like this: import pyaudio p = pyaudio.PyAduio() def play_wave(stream, wave): chunks = [] chunks.append(wave) chunk…
sCuper
  • 91
  • 2
  • 8
4
votes
2 answers

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

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…
physicsmichael
  • 4,793
  • 11
  • 35
  • 54
4
votes
2 answers

PyAudio Play multiple sounds at once

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…
Josef
  • 147
  • 2
  • 12
4
votes
3 answers

PyAudio Responsive Recording

I've seen the recording tutorial on the PyAudio website for recording a fixed length recording, but I was wondering how I could do the same with a non-fixed recording? Bascially, I want to create buttons to start and end the recording but I haven't…
Malik Brahimi
  • 16,341
  • 7
  • 39
  • 70
4
votes
1 answer

How can PyAudio use my computer's microphone?

In order to record a 2 second wav file I used PyAudio (with Pyzo) and the following classical code to record a sound and save it : import pyaudio import wave chunk = 1024 FORMAT = pyaudio.paInt16 CHANNELS = 1 RATE = 44100 RECORD_SECONDS =…
Zatrzz
  • 49
  • 1
  • 2
4
votes
2 answers

Record and play audio - python

I'm going to implement a voice chat using python. So I saw few examples, how to play sound and how to record. In many examples they used pyAudio library. I'm able to record voice and able to save it in .wav file. And I'm able play a .wav file. But…
gangadhars
  • 2,584
  • 7
  • 41
  • 68
4
votes
0 answers

Python PyAudio Portaudio invalid input device

I want to do something like this: Get an audio sample as float number from pyaudio-stream I'm new to Python and installed PyCharm with all necessary packages. PyAudio creates some problems I'm unable to solve. I have a Win7 64bit and Python 3.4.2…
dtea
  • 41
  • 3
4
votes
1 answer

PyAudio duplicate devices

I'm trying to list my audio devices, but PyAudio is showing some duplicate devices, i think. Here is the result(2 and 6, 4 and 5): 1. {'type': 'input', 'name': 'Microsoft Sound Mapper - Input'} 2. {'type': 'input', 'name': 'Microphone (Realtek High…
user1938667
4
votes
1 answer

python pyaudio using multiprocessing

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…
lollercoaster
  • 15,969
  • 35
  • 115
  • 173
4
votes
3 answers

Prevent ALSA underruns with PyAudio

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…
Kritzefitz
  • 2,644
  • 1
  • 20
  • 35
4
votes
3 answers

build pyaudio with portaudio with ASIO support

I'm running Python 2.7.3 [MSC v.1500 32 bit (Intel)] on win32. I need to build portaudio with ASIO support and bind it to pyaudio to use it under Windows 7. Basically I want to access ASIO driver from python and I figured out this is the way. I'm…
4
votes
2 answers

Using any other values in pyaudio for rate / format / chunk give me the error: [Errno Input overflowed] -9981

OS: Mac OSX 10.7.5 Python: Python 2.7.3 (homebrew) pyaudio: 0.2.7 portaudio: 19.20111121 (homebrew - portaudio) The following script outputs the following and displays the issues I am having: #!/usr/bin/env python import pyaudio from pprint import…
the_real_one
  • 467
  • 2
  • 4
  • 13