Transcoding a .vox file to .wav to be streamed to a browser to be played resulted in no content in the http response.
var transcode = sox({
// equivalent to: play -t raw -r 8000 -c 1 -e mu-law -b 8
input: { type: 'raw', rate: 8000, encoding: 'mu-law', bits: 8, channels: 1 },
output: { type: 'wav' }
});
...
new stream.PassThrough().end(data.Body)
.on('error', err => reject(err))
.pipe(transcode)
.pipe(res);
It was discovered that the sox binary was causing a segmentation fault. However, the code did not trigger an error. Even having a transcode.on('error', handler) did not call the handler.
Although rare, a segmentation fault in sox library should trigger the 'error' event handler in the library.
Transcoding a .vox file to .wav to be streamed to a browser to be played resulted in no content in the http response.
It was discovered that the sox binary was causing a segmentation fault. However, the code did not trigger an error. Even having a
transcode.on('error', handler)
did not call the handler.Although rare, a segmentation fault in sox library should trigger the 'error' event handler in the library.
nodejs: v12.8.0 sox-stream: v2.0.3 docker image: 12.8.0-alpine sox: 14.4.2-r3