Closed kehboard closed 4 years ago
What operating system are your running?
Windows 10 x64, python 3.7
Do you get an error message? What kind of sound card are you using? I'll try to replicate your error tonight.
My audiocard is Realtek High Definition Audio (built-in soundcard in my laptop). I have not any error messages. I except when no sound on input record method returned array with zeros
The latest commit should fix your issue. Apparently loopback devices do not return any audio data when there is no playback stream active.
Could you check that the fix works on your machine?
It works on my machine
`import soundcard CHANNELS = 1 RATE = 44100 CHUNK =100
device = soundcard.all_microphones(include_loopback=True)[0] while True: data = device.record(CHUNK, samplerate=RATE, channels=CHANNELS) print(data) ` When i have sound on device this code is running ok. When i havent sound on device code freezes.
P.S. Sorry for my English