Questions tagged [python-sounddevice]
167 questions
1
vote
1 answer
How do I open an audio output stream using sounddevice in python?
I am trying to make my audio interface continuous play the same audio in a loop. Someone recommended the use of the "OutputStream" function in the sounddevice library. This is the code I wrote to do this:
sounddevice.default.device = "Focusrite USB…

PetSven
- 366
- 3
- 13
1
vote
0 answers
is it possible record computer sound and microphone at the same time in python?
I need to record a web call with python.
I managed to record the microphone voice with sounddevice module, but that's not what I want, I need to record both microphone and computer sound which is the other voice.
that's what I did to record the…

LorDAhmeD
- 120
- 7
1
vote
0 answers
Python unable to record audio
I know there are similar questions about this out there, but I haven't found an answer to this problem yet.
My (albeit unoriginal) goal is to create a Virtual Assistant via Python and eventually be ran on a Raspberry Pi. I started with just most…

JustTryingNotToFail
- 35
- 1
- 6
1
vote
0 answers
Detecting a noise within an audio stream in Python
My goal is to be able to detect a specific noise that comes through the speakers of a PC using Python. That means the following, in pseudo code:
Sounds is being played out of the speakers, by applications such as games for example
My "audio to…

RenegadeAndy
- 5,440
- 18
- 70
- 130
1
vote
0 answers
Can we use python yield and create a generator object for audio data in .wav format and get them back?
I want stream my data(audio) from my pc to server. During this process I am ending up saving files on server. I want some suggestions on how I could use the data I stream to server without saving the data on the server. I got to know about python…

Bharath_Raja
- 622
- 8
- 16
1
vote
3 answers
PortAudio library not found by sounddevice during runtime [WINDOWS]
PROBLEM:
Similar to this question for Linux, I'm running into a OSError: PortAudio library not found after I package my app with pyinstaller and execute the .exe. (Note, I do not encounter any issues when running my unpackaged app via shell. This…

Tyler Dane
- 951
- 1
- 14
- 25
1
vote
0 answers
How do I do to make a sound file play to two different devices?
I'm trying to play a sound file play to two different devices and so I've tried the multiprocessing and threading modules but it doesn't yield the wanted result
At first, I wanted to execute the function that plays the file twice at the same time…

Joseph Dittrick
- 13
- 4
1
vote
1 answer
Is there a way to create a simple user-interactive music synth in python
I am currently trying to write a python synthesizer using either pygame.mixer or sounddevice to output the samples of a sine wave I've created in a numpy array. The duration of the wave has to be stated before creating the sine wave for example:…

harveyf2801
- 11
- 2
1
vote
1 answer
storing reaction times with event.getKeys while playing a sound with sounddevice
I coded an experiment in which participants are presented with a series of visual stimuli (stim duration: 100ms, trial duration: 500ms). Simultaneously with the onset of the visual stimuli, there is a sound playing for 100 ms.
Some of the visual…

Malina
- 11
- 2
1
vote
1 answer
Multiple inputs on sounddevice
I have 2 sound cards I have to take inputs from, process it and feed to the output of the third card. I assume that sounddevice lib is the best option for that purpose because it directly works with numpy arrays which are extremely comfortable to…

yahweh
- 193
- 2
- 8
1
vote
1 answer
Play two input with each output on two different channels simultaneously using sounddevice
I have two different wav files which are both in mono, what I am trying to do is combine both using sounddevice and mapping the first wav to the first channel and second wav to the second channel and play both at the same time.
weight = 1.4
data, fs…

Gobinda Sinha
- 99
- 1
- 9
1
vote
1 answer
Python - read audio stream
So I'm trying to set up an app that records a audio input from a microphone, and checks to see if you say a specific phase/command. Once it reads that command, it then launches a function. I'm recording audio input using the sound device package.…

AJ_
- 3,787
- 10
- 47
- 82
1
vote
1 answer
Start and Stop SoundDevice Stream in Different Functions
I am trying to use sounddevice OutputStream within my PyQt application to play sound.
I want something like
import sounddevice as sd
def callback(...):
#stuff that works with a "with" statement
class MyApp(QtWidgets.QMainWindow):
def…

VictorC
- 71
- 7
1
vote
1 answer
Python Sounddevice.play() on Threads
I am having some problems to play the sounddevice on a Thread. I import the sounddevice as sd at the beginning. Then during running I want to play a tone on a thread using the ASIO sound card. All the configurations I need to do on the thread works…

Laura
- 11
- 3
1
vote
1 answer
how to gracefully stop python sounddevice from within callback
I'm using Python sounddevice and PySoundFile to play audio "the hard way", that is, using a non-blocking callback. (Tip of the hat to https://stackoverflow.com/users/500098/matthias and crew -- these packages are easy to use and do everything I…

fearless_fool
- 33,645
- 23
- 135
- 217