Questions tagged [python-sounddevice]

167 questions
0
votes
2 answers

Python: Eliminating gaps between segments of recorded audio

I am using Python sounddevice library to record audio, but I can't seem to eliminate ~0.25 to ~0.5 second gaps between what should be consecutive audio files. I think this is because the file writing takes up time, so I learned to use…
rfii
  • 562
  • 3
  • 14
0
votes
0 answers

EFO error when using a library command, inside of a library command

So I have a project I've been working on that mixes the Audio library Sounddevice and the input library Keyboard. By themselves I have been able to make things work, but when I mixed them I started running into trouble. Specifically if I take the…
0
votes
0 answers

Sound Device library errors

So I have been trying to work on a project that involves audio, so far every single library I have tried has broken in one way or another, I figured last resort could be Sound Device because it seems to have some other interesting properties I…
0
votes
3 answers

Python Sounddevice Callback returning an array with zeros

I am trying the Python Sounddevice lib to stream audio from the microphone self.audio_streamer = sd.Stream(device=self.input_device, channels=self.channels, samplerate=self.sampling_rate, dtype='int16', …
vinzzz
  • 2,084
  • 2
  • 14
  • 23
0
votes
1 answer

How to create a surround effect using python by controlling the volume of speakers channels?

I have bought a soundcard: Focusrite Scarlett 4i4 3rd Gen, with 4 outputs channels. I also have 4 speakers and I will link each speaker with the soundcard. I would like to be able to set separately the volume of each speaker, with maybe a tkinter…
TrissN
  • 35
  • 8
0
votes
0 answers

Program freezes if network audio device becomes unavailable while playing audio

I have a python program that loops, playing audio files using python-sounddevice on an output device connected using dante virtual soundcard. While playing the audio, if the network connection is suddenly lost, the program becomes completely…
mBAY
  • 1
  • 1
0
votes
0 answers

Recording device audio using python

I am trying to record device audio using Python. It seems that pyaudio only works with external devices. It seems that sounddevice as sd is the answer as it lets us choose default device. The code is sd.query_devices() to get the list of available…
0
votes
1 answer

Slight delay in beginning of recording, and end gets cut off with low level streams in python-sounddevice

I'm trying to create a low-level Stream that will allow me to output a WAVE file, while simultaneously recording an input on the same audio device. My audio device is setup so that the output WAVE file will be played through the output and this runs…
LarryF
  • 13
  • 3
0
votes
0 answers

Trying to play back audio data with the sounddevice module but im quite stuck

I'm trying to play back an audio stream with the sounddevice module, ive tried many ways but they all don't make much sense and don't seem to work for me at all, the data 100% is valid and if saved to a file it plays back perfectly so i know the…
0
votes
0 answers

What is the unit of the output of a sounddevice recording?

Is it in volts, decibels, or something else? I need the units in order to label the y-axis of a plot of the sound wave. I tried looking up documentation but couldn't find any information about units. To be more specific, I want to know the units for…
0
votes
0 answers

how to detect and remove glitches while cutting the audio?

I want to cut the audio files. However, whenever I cut it, there adds a glitch, a cutting noise where I cut the audio. How can I remove this noise? The code I use to record the audio is: import sounddevice as sd from scipy.io.wavfile import…
0
votes
1 answer

How can I record from two devices at the same time using sounddevice?

I currently have 2 audio codecs suitable for input and I want to record from them at the same time and not sequentially. This is how I see my devices: import sounddevice as sd sd.querydevices() output: < 0 DisplayPort, Core Audio (0 in, 2 out) 1…
user391339
  • 8,355
  • 13
  • 58
  • 71
0
votes
1 answer

Sounddevice exit code 0

I am working on a genre identification project and trying to utilize sounddevice to input the audio. I have attempted using sample code from their website as well as stack overflow but am unable to get the codes to run without finishing with exit…
0
votes
1 answer

How do I play audio on one USB device and record audio on another simultaneously in Python?

I am writing a program in Python to play audio on a Focusrite Scarlett 6i6 while simultaneous recording another waveform on a Picoscope 2205AMSO. To play audio on the Focusrite, I am using the sounddevice library: sounddevice.play(noise,…
PetSven
  • 366
  • 3
  • 13
0
votes
0 answers

Detecting a noise in an audio stream

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: Sound is being played out of the speakers, by applications such as games for example, ny "audio to…
RenegadeAndy
  • 5,440
  • 18
  • 70
  • 130