Open antondim opened 4 years ago
Was this done already? Sounds useful!
It's quite easy to do in Python. Here's an example:
import wave
wav = wave.open(name, "wb")
wav.setparams((CHANNELS, 2, SAMPLE_RATE, 0, 'NONE', 'not compressed'))
wav.writeframes(audio_chunk)
wav.close()
Was this done already? Sounds useful!
I Added a simple version of test_microphone.py with wav saving option on a different branch of my forked version of vosk-api on my github.
Bear in mind that my initial version of "test_microphone.py" was of an older state of vosk-api. I did not check the updated versions, although I doubt that the logic would be any different. So you can somehow, incorporate the same logic on newer versions of "test_microphone.py" scripts.
I gave this a try and when I try to open the file in Media Player on Windows 11 and it won't open, showing the error:
We can't open [filename.wav]. This may be because the file type is unsupported, the file extension is incorrect or the file is corrupt. 0xC00D36C4
Any ideas on why that would be happening?
Hello,
would it be helpful to add my implementation of such a feature on "test_microphone.py" ?
This would enable someone (who's not very familiar with audio data manipulation) to listen to the (uncompressed and lossless) stream audio input which is parsed to the Recognizer for audio device debugging or w/e reasons.