Questions tagged [python-sounddevice]

167 questions
0
votes
1 answer

How to specify which recording device to use with python sounddevice

I want to use the following function twice. This function converts live audio input into a wav file. For the first time, I use my pc built-in microphone and for the second run, I use my headphone's microphone that I plugged in before I run the…
raz erez
  • 79
  • 1
  • 3
  • 12
0
votes
1 answer

How to stop a stream.write function in sounddevice

Is it possible to stop a stream.write function before the buffer is consumed completely? When I try to do so, the sound is stopped, but the stream.write function never returns. This is a working example of how I want to use a small class to play…
bienqueda
  • 89
  • 5
0
votes
0 answers

How do I pitch shift some audio in python?

I am looking to pitch shift the audio contained in the sample variable to a specific frequency without changing the speed of the audio. Here is the code I have so far. import sounddevice as sd SAMPLE_RATE = 48000 def record_sample(): …
joe
  • 463
  • 4
  • 17
0
votes
1 answer

How to play two sounds at once using Python?

I'm looking to make a loop system (inspired by Marc Rebillet, check him out) and am struggling with getting 2 sounds to play over themselves. I've started out using sounddevice, as it's the first audio module that I found, but I'm not sure if…
jon_groth34
  • 43
  • 1
  • 2
  • 6
0
votes
0 answers

Sounddevice: portaudio library not found

Pretty much like this question: PortAudio library not found by sounddevice during runtime [WINDOWS]. The python script worked perfectly fine but when i packaged it into executable program using pyinstaller, it returned OSError: PortAudio library…
0
votes
0 answers

Sounddevice's wait() method not working for short sounds

For a project including a moving robot arm, i need a "Geiger-Müller counter"-like distance-based alarm. For that i wrote a python module and tried to add the posibility, if the robot arm is on the left side of an object, the sound is only on the…
Rackor
  • 61
  • 2
  • 7
0
votes
1 answer

python-sounddevice won't detect all input channels on audio interface (windows)

I am using a Focusrite Scarlett 18i20 audio interface, where I need to use at least 4 of its inputs to record the impulse response. I am running on a Windows 10 PC, using python (anaconda) and sounddevice. When I use sounddevice.query_devices(), it…
0
votes
1 answer

Using multiprocessing on audio streams

I would like to continuously record and audio. This is easily done using python's sounddevice module. However, I also wanted to start sending the chunks to a thread that works in the background when the audio gets more than 20 frames. The…
0
votes
1 answer

How to stream audio to num py array

I am trying to create a streaming app on flask but i can figure out how to make sound to num py array.I have tried: import sounddevice as sd # seconds def callback(indata, outdata, frames, time, status): if status: print(status) …
0
votes
2 answers

How to playback realtime audio in python while also constantly recording?

I want to create a speech jammer. It is essentially something that repeats back to you what you just said, but it is continuous. I was trying to use the sounddevice library and record what I am saying while also playing it back. Then I changed it to…
Mataan P
  • 117
  • 1
  • 8
0
votes
1 answer

sounddevice record "out" parameter

I would like to use the "out" parameter to write a recorded signal to a given numpy array but I don't get any audio appended to the array I am passing it. Should a samplerate be defined if I want it to use the default samplerate? There is no…
0
votes
0 answers

Python 3 neopixel non-functional

import neopixel import board import sounddevice as sd from numpy import linalg as LA import numpy as np def getvolume(indata, outdata, frames, time, status): volume_norm = np.linalg.norm(indata)*10 with sd.Stream(callback=getvolume): …
0
votes
0 answers

Python file works differently when lunched from Visual Studio compared to running it with Anaconda Prompt

I'm quite new to python and I've been working on a simple program that would record sound, modify it a bit and then playback it. I wrote it in Visual Studio but this software won't work for me with sounddevice and says No module named…
0
votes
1 answer

Using Python sounddevice for multichannel acquisition on two devices

I'm trying to output upto 4 channels of audio from my RME Fireface UCX sound card and acquire 16 channels of audio data on my miniDSP 16-channel microphone array. At present if I use a combination of the listed devices from the query_devices…
davlar
  • 3
  • 3
0
votes
1 answer

Sounddevice ValueError: could not broadcast input array from shape (2048) into shape (2048,1)

I know it may seems to be another one of those ValueError post but please hear me out and understand that I have tried Googling and browsing the StackOverflow community for a workable solution for my problem. I am currently trying to pass my…
Seaarmy
  • 65
  • 1
  • 2
  • 9