177 questions
1
vote
0
answers
54
views
Sounddevice plays loud noice instead of speech
I'm trying to make a script that would take some text and turn it into a speech using edge-tts and then stream it using sounddevice, so that playing audio begins right after edge-tts finished it's job....
0
votes
0
answers
131
views
Input audio from microphone not collected when audio is reproduced
I'm developing a simple real-time voice bot using the OpenAI real-time API, specifically integrating with Semantic Kernel. The code is written in an async manner, and it initially works well. However, ...
1
vote
0
answers
93
views
How to reduce delay between measured start and end time of a sound signal played using sounddevice
I have a simple sine signal of duration 100 ms that I play on my speakers using the sounddevice library. I am trying to measure the exact time point a sound signal started and ended being played. ...
0
votes
0
answers
43
views
What frame rate to expect using Python sounddevice.InputStream on macbook?
I record audio on a macbook using this code:
def callback(indata, frame_count, time_info, status):
if status:
print('Error:', status)
frames.append(indata.copy())
...
0
votes
0
answers
334
views
How do I import sounddevice in python?
import sounddevice as sd
I god the following error:
PS C:\Users\Karlerdo> & "C:/Program Files/Python313/python.exe" c:/Users/Karlerdo/Desktop/voicereqpy.py
Traceback (most recent ...
1
vote
0
answers
111
views
Problem with a simple script in which the Librosa Python library does not work well for me
I have a problem with the script that I detail below;
My intention is to automate a click the moment an alarm sounds on my PC.
I have used the 'Sounddevice', 'Librosa', and 'PyAutoGui' libraries, in ...
0
votes
0
answers
48
views
I need to automate a process on the PC when a specefic sound plays on it
I would like to know if it is possible to automate a simple click to stop sending automatic emails. For example; If I am using the 'Playstatic' program (it is an application to perform loop processes ...
0
votes
0
answers
285
views
How to calculate the dBFS level using python sounddevice
I'm trying to get a decibel reading from an audio stream using the sounddevice library.
More specifically, I want to display the current level in a DAW like fashion.
According to this, most DAWs ...
0
votes
1
answer
127
views
Sounddevice in python, time vector of input and output signal synchronized
In Python, with sounddevice, I am trying to simultaneously play on an output and record on an input, then to plot the signals on top of each other in a way to represent what is happening in the real ...
0
votes
0
answers
389
views
Python Sounddevice / sound is played way to fast over the speaker
i'm trying to stream or play data with python with the module sounddevice.
However when it is streaming or playing over my speakers it is way to fast to understand anything.
when i'm playing the wav ...
1
vote
0
answers
116
views
Sounddevice simultaneous audio playback auto gain problem
I'm using a Raspberry Pi along with a HiFiBerry DAC + ADC PRO to generate and transmit white noise, and then I'm capturing and reading it back in using a loopback configuration. I use the Sounddevice ...
0
votes
1
answer
261
views
Removing Click and Pop sounds in Python
I'm currently making a DSP project with Python, which is equalizing in 10 bands with knob UI made by tkinter. This is my Audio Processing Logic with using RFFT and IRFFT, and streaming with ...
0
votes
1
answer
44
views
Python Qt5 Running two methods simultaneously
I have a Qt timer that I want to count down while I record (using the sound device package), I'll attach what I have below (I know it is very far off from anything correct). I've been reading up on ...
0
votes
1
answer
188
views
Python Sound Device Recording
I am trying to create a .wav file by recording from a USB microphone connected to my computer. I am trying to accomplish this using Python. I keep seeing the following example (or something similar) ...
0
votes
0
answers
414
views
python sounddevice: asynchronous playback with complicated callback
I'm using the python sounddevice module to provide "audio feedback" for a digital sensor. The idea is I have a sensor with one-dimensional time-series data being read in at 40 Hz. I have a ...
0
votes
1
answer
200
views
Adding "Hold Parent Note" functionality/ "Extending the duration of a note being played"
Overall, this script provides a simple way to input musical notes and have them played as sound through the computer's speakers. The notation allows for various musical constructs such as pauses, note ...
1
vote
0
answers
712
views
using float32 to transcribe sound by openAI's Whisper ai transcribe() in python
I am trying to capture audio data from microphone using sounddevice module's rec() function, storing as float32 and feeding it to whisper's. But I don't want to save the audio as a file and recall it.
...
0
votes
2
answers
320
views
Python Sounddevice implementation sounds choppy
I am currently playing around with the python library sounddevice. Now I have the problem that with the following implementation the sound sounds choppy, as if there was an underflow or clipping. Here ...
1
vote
1
answer
121
views
Sounddevice + big array + OOP = Segfault / Bus Error
I'm having a very strange problem, which I managed to reduce as much as possible like this:
import sounddevice
import time
class SamplerBox:
def __init__(self):
self.samples = {}
def ...
1
vote
1
answer
274
views
extracting numpy array from pyaudio results in noise and distortion
My goal is to record the audio output from my computer, process it in real time and then react to it in real time. I am using PyAudio with a patch that allows loopback devices. I can record the audio ...
0
votes
1
answer
294
views
Sounddevice Output Overflow
I have troubles of unknown kind with the sounddevice module for Python.
The code below outputs a GUI where you can output a sine wave of a user-defined frequency. Additionaly, one can modulate its ...
0
votes
0
answers
254
views
Python sounddevice library is not recording sound on my ubuntu 22.04 Dell laptop
I'm running Visual Studio code on my Ubuntu 22.04 laptop. The code is very simple to record a piece of sound using the sound device library.
import sounddevice as sd
duration=10
fs=8000
my_record=sd....
0
votes
1
answer
107
views
Audio routing between apps
I have a Python voice-enabled chatbot that plays and records audio. However, the chatbot is also recognizing its own audio output as input. Is there a way to prevent this? Is there a specific app that ...
0
votes
0
answers
147
views
Only 3 microphone streams are open on Raspberry Pi 4
I typed a code that listens to 8 USB microphone inputs simultaneously on the Raspberry Pi 4 B 4GB.
It ran fine on the PC, but only partially ran on the Raspberry Pi.
I confirmed that multiprocess and ...
2
votes
1
answer
2k
views
How to record audio with python sounddevice on WSL?
I am on WSL, and when trying to record audio using sounddevice, I get an error saying no device was found: sounddevice.PortAudioError: Error querying device -1.
I followed sounddevice's instructions ...
0
votes
1
answer
133
views
Is there any way to respond when a specific frequency (combination) is heard from the system sound in python?
I am currently attempting to create a modem-like script in python that uses sound to respond to other instances of itself with sounddevice, kind of like a real modem used in the older days.
I have ...
1
vote
1
answer
319
views
The sounddevice library in Python plays music, how to control the volume of different channels
I use OutputStream in sounddevice to control the music stream and set the volume level of the different streams in its callback function. It is normal for each channel to have a volume of 0, but if I ...
1
vote
0
answers
185
views
Using Python as a speaker to intercept audio
I'm developing an app just for me which should act like a speaker in my Windows computer and record the data being sent to it.
Here's the code so far:
import soundcard as sc
import numpy
outputLib = ...
0
votes
0
answers
391
views
How do I get the live sound level of output speaker in Python on windows 10?
For a project i need to detect if system is playing some audio through its output speakers (internal or external speaker). Basically i need to get volume level of speaker at that moment so that i can ...
1
vote
1
answer
318
views
What technique is required to remove unwanted frequencies in my sine wave audio signal
I have created a sine wave that the user can change its frequency in real time using inputs of the key board, however there is a lot of noise I believe to be harmonic waves present in the audio output ...
-1
votes
1
answer
81
views
pyinstaller doesn't like sounddevice
Our Python 3.7 project is using sounddevice and it runs just fine, but we recently updated pyinstaller to 5.10.1 and the new version of pyinstaller doesn't like sounddevice.
BTW, updating pyinstaller ...
0
votes
0
answers
175
views
Alternatives to sounddevice.playrec()
I have been using sd.playrec() to play and record a sine-sweep in a room at the same time. This happens as part of a python script. However, there is a delay between when the recording starts, and ...
2
votes
2
answers
915
views
No mic get detected as sound.query_devices() returns empty list?
Im trying to get the feed of the mic using "sounddevice" library in Python.
import sounddevice as sd
print(sd.query_devices())
But it returns empty list.
I tried arecord -f cd -d 6 test....
2
votes
0
answers
169
views
How to play 2 pieces of audio in parallel through different speakers? - python
I have two pieces of audio: (1) 15 heartbeat clips and (2) 15 frequency noises.
The frequency noises are only 1 second and shorter in duration than the heartbeat clips (generated on-the-fly, variable ...
1
vote
0
answers
279
views
Audio Recording In Python Can't Hear Output
I found some code online that is supposed to record audio using soundfile but after creating the recording, when I play it back, I can't hear anything. However, the recording is the correct duration, ...
0
votes
1
answer
1k
views
sounddevice.PortAudioError: Error querying host API -9979
I am trying to do python audio with python-sounddevice on a macOS 13.2.1 with M1 chip but I can't get it to work. I installed portaudio and libsndfile with brew, then created a conda environment with ...
0
votes
2
answers
367
views
How to record system audio in python
I tried to record audio with this code:
import sounddevice
from scipy.io.wavfile import write
fs = 44100
second = 3
file = sounddevice.rec(int(second * fs), samplerate=fs, channels=2)
sounddevice.wait(...
0
votes
1
answer
245
views
Python- voice detection using Tensorflow
I am making voice detection by using Tensorflow. The computer will be recording my voice and when I say:" Hey Jarvis" it will print "voice has been detected". However, the program ...
0
votes
1
answer
800
views
Python ImportError of "sounddevice" on M1 Mac when running script in PyCharm (incompatible architecture)
I have an M1 Mac. My program was running fine in PyCharm when using the Intel-based dmg. PyCharm kept notifying me to upgrade to the version optimized for Apple Silicon. PyCharm opened noticeably ...
3
votes
1
answer
3k
views
Error when recording sound with sounddevice
I want to use sounddevice to capture (record?) audio that is coming out of my speakers. My speakers have two channels.
This is my code (which I found here https://realpython.com/playing-and-recording-...
1
vote
0
answers
355
views
How do you get the correct device for a sounddevice recording
I have been trying to record my device's audio, but I can't get it to work properly.
So far I have tried the following
from sounddevice import rec, default
from soundfile import write
fs = 48000 # Hz
...
0
votes
1
answer
844
views
Why does python sounddevice returns nothing?
I'm using wsl version 2 and Xlaunch to connect with x11 server. The problem is when I'm running this code:
import sounddevice as sd
print(sd.query_devices())
It returns nothing or even running $...
1
vote
0
answers
137
views
How to correctly make use of multithreading to run my program faster?
How can I correctly make my code run faster? Following is my attempt at making use of multithreading. However, I do not understand where to join the threads. I want the results to be printed serially, ...
0
votes
0
answers
41
views
Freq Response Error "Float Object is not subscriptable"
So I'm currently working on a code for linear prediction, where we apply the various concepts of linear prediction into a raw audio signal
In this code I have m as the len of the audio that i inputted,...
1
vote
0
answers
468
views
Using python sounddevice query string to select device
I'd like to select a particular sound device to use for audio input via python sounddevice.
The sounddevice docs make reference to using "query strings" to select devices (based on the ...
1
vote
0
answers
84
views
Sounddevice - Test callback fucntion
I have some code that uses the sounddevice library in a callback function. I need to use pytest inorder to test this callback function.
I am simply trying to test if the callback function does not ...
0
votes
2
answers
829
views
Trying to play multiple frequencies in python sounddevice blow horrific speaker sounds and an error message saying "alsa underrun occurred"
I tried different ways to play sine waves in sounddevice, and they worked fine, until I tried to overlay multiple frequencies at once. I also get loud scratching noises in my speaker whenever there ...
1
vote
0
answers
150
views
Expose PC playing MP3 files to Android as USB microphone
Probably an unusual request, but here goes...
I'm trying to create a script (ideally in Python, but open to other options) that will stream an mp3 file from a computer to an Android Phone's microphone ...
1
vote
1
answer
329
views
How to write an audio file that is inside a for loop in python
I have to write an echo code. So I wrote this code. I want to know how to add each of these in a separate wav file. Can someone provide me with an answer. Thanks in advance.
import sounddevice as sd
...
0
votes
1
answer
139
views
sounddevice freezes the tkinter GUI
I want to make a voice recorder with sounddevice and tkinter module in python.
I want to make my app to start recording when the "Start Recording" button is pressed. After that, I want that ...