Questions tagged [python-sounddevice]

167 questions
0
votes
1 answer

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 smoother. But trying to run my script now gives me an…
nhershy
  • 643
  • 1
  • 6
  • 20
0
votes
0 answers

python sounddevice play mono 1-ch wav file back on specific output channel of sound card

I am trying to have a python sounddevice script that will use a 1-ch audio wav file and to play back on a specific output channel of my sound card (for example ch3 only). I wasn't sure exactly how to do that with the mapping arg for…
BTBts
  • 13
  • 1
  • 5
0
votes
1 answer

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 $python3 -m sounddevice ,again returns nothing. what…
fatemeh_p
  • 21
  • 4
0
votes
0 answers

How to record live audio? And is it possible to do live DSP?

I am currently working on a project where I have to record live audio on my microphone. After this we want to run some digital signal processing, by applying some filters. Right now we are using pyaudio and are recording audio. However, as far as I…
0
votes
0 answers

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, now I get this error here when I try to code…
0
votes
0 answers

Python: portaudio can't update audio devices [Mac]

I install portaudio by homebrew (brew install portaudio) then I use sounddevice.query_devices() to get all available device on my Mac, but when I change device and recall sounddevice.query_devices() that not update new device. I trying to use this…
KiDo Ruan
  • 1
  • 1
0
votes
0 answers

Python-sounddevice - save audio recordings of arbitrary duration repeatedly

I’m working on a script to assist with audio dataset creation for training tts software. I have a demo script using sounddevice and soundfile that can record a single audio file and end recording on keyboard interrupt, but I can’t seem to figure out…
Jcwscience
  • 17
  • 3
0
votes
0 answers

Playing an audio file with more than 2 channels

I have an WAV audio file with 3 channels: 2 for the sound (stereo) and 1 with short pulses to help record and synchronize with an external device (for a scientific experiment, not important). The thing is: I have a sound card with 4 audio inputs and…
YoelGo
  • 1
0
votes
0 answers

Is it possible to set a user-inputted value to sd.playrec() for modifying the recording duration?

I am building a web application for the determination of room impulse responses. I'm currently using streamlit for the GUI part, this is an extract of my code relevant to sounddevice: from pathlib import Path import streamlit as st import numpy as…
0
votes
2 answers

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 are no frequencies to play. I've simplified my code…
0
votes
1 answer

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 sounddevice module records while the stoprec variable is…
0
votes
1 answer

Can we use sounddevice library in Python to play an audio file (.wav or .mp3) on a virtual cable instead of pygame library in Ubantu?

Can I work with Virtual Cables in Ubantu using sounddevice library of Python? I am trying to play an audio file on a Virtual Cable. I have done this using pygame library. Now, I need to do it using sounddevice library. Is there a way?
0
votes
1 answer

Python sounddevice.rec(), dtype ='int8' quantizes to zero problem

I am trying to plot my voice signal, with different dtypes (the bits/sample obviously). So i tried to capture my voice with dtype = 'int16' and the plot made sense. But i tried to speak in the same sound level with dtype = 'int8' and my plot is a…
0
votes
1 answer

Play a sound asynchronously in a while loop

How can I play a sound asynchronously in a while loop, but don't overlap the sound. Wait for the previous play to finish and only then play it again and so on, until the while loop is running. And of course, the while loop should continue to run…
masky007
  • 608
  • 1
  • 6
  • 20
0
votes
0 answers

how can I fix python voice recorder function error?

I have been trying to program a voice recorder but it gives me an error that I have never seen. This is pythmy code: import sounddevice as sd from scipy.io.wavfile import write def record(name , duration): freq = 48000 duration = 10 …
mohaka
  • 23
  • 6