Audio Recording in Python

I want to record short audio clips from a USB microphone in Python. I have tried pyaudio, which seemed to fail communicating with ALSA, and alsaaudio, the code example of which produces an...

Trying to record from microphone and playback in real time

I'm trying to record data from my microphone and then play it back through the speakers in real time, and with some delays, but I'm having some problems with it. I chose to use python and...

Change audio card on pyalsaaudio

I need to change the audio device used on a python script. I'm using alsaaudio, and according to this http://pyalsaaudio.sourceforge.net/libalsaaudio.html this is achieved just by entering the...

Problems with pyspotify on OSX

I am messing around with pyspotify on a Mac, and I've been reading up on examples and documentation. I have an example application (the jukebox.py example from the pyspotify git repo) downloaded,...

Python having trouble accessing usb microphone using Gstreamer to perform speech recognition with Pocketsphinx on a Raspberry Pi

So python is acting like acting like it can't hear ANYTHING from my microphone at all. Here's the problem. I have a Python ( 2.7 ) script that is suppose to be using Gstreamer to access my...

Streaming alsa pcm speaker output from a python application

been doing some research for a project and wondering how I am able to stream the raw data from my alsa device to a python/C++/java application. I have been messing around with alsaaudio, the...

Pygame playing sound with pygame.mixer.music.load(file) gives NoneType error

I've tried everything but i can't seem to get the file to play from pygame.locals import * import pygame, codecs, os class player(object): def __init__(self): self.get = dict() ...

alsaaudio library not working

Has the alsaaudio library been ported to python3? i have this working on python 2.7 but not on python 3. is there another library for python 3 if the above cannot be used?

Stream mp3 icecast data using python

I'm trying to write my own socket streamer where I connect to a know mp3 source using python's socket, stream the data and try and pass it into alsaaudio as pcm data. I know have to get the...

Open audio with callback using ALSA

Is it possible in Python, using ALSA, to access the audio hardware for playback, with a callback function: def audiocallback(): # create some audio and return a buffer of 1024 samples (~23 ms...

Python: mp3 to alsaaudio through ffmpeg pipe and wave.open(f,'r')

I'm trying to decode mp3 to wav using ffmpeg: import alsaaudio import wave from subprocess import Popen, PIPE with open('filename.mp3', 'rb') as infile: p=Popen(['ffmpeg', '-i', '-', '-f',...

Confusing Python-AlsaAudio Output, No sound on square wave generator

So I'm working on this project programmed in python that requires audio output. It generates square wave audio, so you can hear a click from the speaker from when the audio changes from high to...

Rpi wheezy duplicate capture on usb & dummy cards

I am trying to create an application that will stream audio with Darkice as well as provide a LED VU meter indication of the audio stream. I have created a virtual card with . This card is...

Calling Tkinter class from another class (Python on Raspberry Pi)

I am stumped as to why the Display class isn't running in the following code. I call it using Display(root) in main(). The main class runs just fine. I don't get any errors in...

Using Python Tkinter on Beaglebone: Display Flicker

Below is the code for displaying data on a monitor using Python and Tkinter on BeagleBone. It works great, but the text which displays the data flickers. Any ideas why? #!/usr/bin/python import...

Using Python Tkinter .config() method

I am trying to use the Python Tkinter .config() method to update some message text. I can't get it to work. What might I be doing wrong (see the update_message method): #!/usr/bin/python import...

Python Tkinter on Debian Beaglebone: lost font styling when changed directory name

I have installed non-system fonts onto BeagleBone Black (Debian Jessie) and have been using them in a GUI created using python 2.7 script via Tkinter and tkFont. When I changed the name of the...

Capture desktop audio on Raspberry Pi

I want to do an audio visualisation with the Raspberry Pi. I already have a python script that uses the alsaaudio library. It captures the sound output and analyzes it.It works on my Linux Desktop...

Python alsaaudio capturing sound

I'm trying to capture data from microphone. Code is pretty simple but I get the error alsaaudio.ALSAAudioError: Capture data too large. Try decreasing period size for some reason. Tried google it...

Python alsaaudio and pjsip conflict

I writing app in python that uses pocketsphinx and pjsip I use pocketsphinx keyword search to wakeup the app and pjsip as phone the problem is when I try call the "call" function and after that...

Reading audio data from an ALSA buffer to a numpy array

I'm trying to pull data from an ALSA buffer in order to generate count noise from a mic. However, when I try to convert the data to an array I get an incorrect result. Below is part of my...

Alsa library configuration

I am using Alsa library to find Maximum value of Sound samples from stereo output.i am using S32_LE pcm Format. From my python code , i can able to acheive max values instantaneously. But from C...

What to put for the alsaaudio python card´╝č

I am trying to use alsaaudio in my python code. inp = alsaaudio.PCM(alsaaudio.PCM_CAPTURE, alsaaudio.PCM_NONBLOCK, card) For the third parameter card, what should I put? [email protected]:~/Desktop#...

Python script stops working on new started applications (python-evdev)

I have been scratching my head for a couple of weeks now, I'm not well diversed in Linux so it's certanly something easy I've overlooked. In my system I got an arduino that sends data via I2C to...

How would I add volume on to the current_volume list in pyalsaaudio?

I'm trying to add on volume to a current set volume, in this case we will say it's 80%. Using the alsaaudio module in Python, there is a function called getvolume #declare alsaaudio am =...

Python failed to build wheel for pyalsaaudio

I'm trying to download pyalsaaudio for python, it was working fine the latest windows 10 update. Now it says that python has failed to build wheel: C:\Users\F.R.E.D.R.I.C.K>pip install...

How to control the volume of raspberry pi with python 3?

I have been looking up the web for any reference to control the volume of raspberry pi (b+) with python script . I come up with this thread previously asked but python-alsaaudio doesn't works with...