serenadeai / speech-recorder

speech-recorder is a node.js module for streaming audio from a device's microphone and filtering for speech.
MIT License
86 stars 19 forks source link

Audio format/information #13

Closed guiandrade2 closed 1 year ago

guiandrade2 commented 3 years ago

I would like to work directly on the audio buffer for further preprocessing, but I do not understand how can I get details like sampling rate and bit depth. After speech being detected, I intend to run further computations such as segmentation and neural network predictions, but I would need these kind of details. Also, from the example, the file format RAW is used, can I still treat the buffer with the audio samples as if it was from a normal .wav file or do I need to do any kind of conversion?

tmacwill commented 1 year ago

apologies for the hugely delayed response here, but this library uses 16-bit, single-channel audio. the sample rate is 16000 unless otherwise specified in the constructor.