Questions tagged [python-sounddevice]
167 questions
1
vote
1 answer
How to save a file from wave and sounddevice?
someone made a script who is supposed to record a wave file and send it at an email address.
I want instead of send it at an email address, save the file.
Here is the code :
import sounddevice as sd
import wave
fs = 44100
seconds = 60
obj =…

Askaat
- 11
- 1
1
vote
1 answer
Is this attempt to implement real randomness valid?
Pseudo-randomness becomes real randomness with the lack of an actual pattern in the series of generated values; so essentially the sequence of random elements that repeats itself is potentially infinite.
I know that the way random.py seed()s is…

Max Shouman
- 1,333
- 1
- 4
- 11
1
vote
0 answers
How to play/pause a numpy sound array?
So I am making a video player, and am playing sound. The audio is in a numpy array. I have a function that can play/pause the video, but I need something to be able to play/pause the playing of the sound. I am using the module 'sounddevice' to play…

Mini Minnow
- 54
- 8
1
vote
0 answers
Python: How to send sounddevice microphone input to flask
I want to create Flask Web Application that can hear sound from Server Microphone and download the last sound by clicking button.
For now, I can read and get sound level and recording the sound using this script
import os, sys, queue,…

Zenaki
- 11
- 1
1
vote
0 answers
sounddevice.PortAudioError: Error opening OutputStream: Internal PortAudio error [PaErrorCode -9986]
I am on MacMojave and try to play a sound file if a microphone signal goes above a threshold. I have :
import sounddevice as sd
import soundfile as sf
import numpy as np
duration = 5 # seconds
threshold = 30
filename = "./data/piano.wav"
data, fs…

chikitin
- 762
- 6
- 28
1
vote
0 answers
There is a sudden noise in audio signal recorded with sounddevice library after importing tensorflow.keras
I have a very strange problem. I am working on a voice command classification application in python, and I am using sounddevice library to record the audio signal. If I record 10 seconds of signal, it looks something like this:
Waveform graph of…

martinkarlik
- 11
- 2
1
vote
0 answers
What format and range does python-soundevice return?
I recorded some audio with
sd.rec(frames=int(duration * fs), samplerate=fs, channels=2, dtype='float32')
This returned a numpy array of dtype np.float32.
When recording some clapping (i.e. a fairly loud noise), min and max where around -14.0 and…

Toby
- 2,174
- 4
- 22
- 32
1
vote
0 answers
How to stop audio recording in sounddevice python library if Twilio call ends using Django?
I have tried to record the call (using twilio services) in django using sounddevice library. But after the call ends, the recording does not stop, it continues recording with the duration of sec that I have input.
I want to stop the recording when…

prashik awachar
- 31
- 4
1
vote
1 answer
Python sounddevice does not produce sound on raspberry pi
I'm trying to get started with programming a small synthesizer (wave generator) on my raspberry pi 3a+.
To start off, I tried to use python's sounddevice module to play a stream from a numpy - array.
However, my raspberry pi doesn't output any…

Dönerspiess
- 13
- 3
1
vote
1 answer
Error trying to record audio using Python/Mac
I have tried pyaudio/sounddevice, and using them leads me to the error: ||PaMacCore (AUHAL)|| AUHAL component not found.Traceback (most recent call last):. I think it has something to do with my mac not giving permission to terminal to use the…

thotbot99
- 25
- 6
1
vote
2 answers
How to play a sound file using an OutputStream in python sounddevice?
The goal is to play two sound files simultaneously so the sounddevice.play function is not an option. I believe that I should make an OutputStream for each file. Right now I'm stuck in trying to get one OutputStream to work. Please help.
My code so…

Khaled Abdulazim
- 11
- 1
- 7
1
vote
2 answers
Importing sounddevice to python crashes
I am trying to import the sounddevice module in python, but whenever I am doing that it seems to crash? I have tried older versions of sounddevice, but still the same issue. I am running Python 3.7.5. This is what the log looks…

Michael L
- 163
- 1
- 1
- 8
1
vote
0 answers
Attempting to use python-sounddevice lower level "stream" classes to play and record with NumPy arrays giving errors
I'm trying to split the audio file into a given number of NumPy blocks and put those into RAM to play, just like play_a_very_long_sound_file. Unfortunately, I believe my knowledge of NumPy arrays and audio files in general is lacking. Once this code…

LarryF
- 13
- 3
1
vote
0 answers
Sounddevice failing at import with Python 3.7.7 (x64) on Windows 10
I get this error message when I try to run the following script, or any script with import sounddevice at top. I installed sound device at cmd as admin with pip install sounddevice and I verified it is there with pip list
Assertion…

rfii
- 562
- 3
- 14
1
vote
0 answers
How do you figure out what the different values in an array correspond to? (sounddevice)
I am doing a project that uses sounddevice in order to record sound. I will also need to use the frequency and the volume of the sound for the project. I have figured out how to record sounds, but I am having trouble figure out how to manipulate the…

EMC
- 91
- 1
- 7