Closed ben-8878 closed 1 year ago
Try to leave the rate default or 44100, some windows drivers can't resample
Try to leave the rate default or 44100, some windows drivers can't resample
it does not work, test with follow codes:
import sounddevice as sd
sd.default.device[0] = 1
fs = 44100 # Hz
length = 5 # s
recording = sd.rec(frames=fs * length, samplerate=fs, blocking=True, channels=1)
from scipy.io import wavfile
wavfile.write('recording.wav', fs, recording)
Maybe it wants two channels or wrong device id. It is not really Vosk issue, you have just problem recording audio.
this is a bug of sounddevice , set utf8 coding in windows, it will met the errors; unset utf8 coding in windows,it will met UnicodeDecodeError:utf-8 error. above error may happen in some pc, not all windows pc met those error.
sorry,the error was blocked by antivirus software, I close it.
run test_microphonepy script,get follow errors: