NodeJS Convert Int16Array binary Buffer to LINEAR16 encoded raw stream for Google Speech API
- 阅读更多 关于 NodeJS Convert Int16Array binary Buffer to LINEAR16 encoded raw stream for Google Speech API
问题 I'm trying to convert speech to text in node server where speech recording happens in the browser using AudioContext. I'm Able to send int16Array buffer(recorded data) to my node server through a WebSocket connection of binaryType:arraybuffer. this.processor.onaudioprocess = (e) => { // this.processAudio(e) for ( var float32Array = e.inputBuffer.getChannelData(0) || new Float32Array(this.bufferSize), len = float32Array.length, int16Array = new Int16Array(len); len--;) int16Array[len] = 32767