I can get the audio to play back from my microphone but it's extremely muffled and it honestly sounds like the program is going to crash.
I tried using an InputStream but the sound is just horrible when I play it back, any idea what I'm doing wrong?
10 is my Microphone while 13 is my output device (speakers)
import sounddevice as sd
device_info = sd.query_devices(10, 'input')
samplerate = int(device_info['default_samplerate'])
sd.default.samplerate = samplerate
sd.default.channels = 2
devices = sd.query_devices()
print(devices)
def callback(indata, frames, time, status):
#print(indata)
sd.play(indata, device=13, blocking=True)
with sd.InputStream(device = 10, samplerate=44100, dtype='float32', callback=callback):
print('#' * 80)
print('press Return to quit')
print('#' * 80)
input()
I have a feeling I need to add it to a queue and play it from the queue?