I am recording audio with the package react-native-audio-record. I want to use the temporary data to visualize stuff. As in the example (function AudioRecord.on) here:
const options = {
sampleRate: 16000,
channels: 1,
bitsPerSample: 16,
wavFile: 'test.wav'
};
AudioRecord.init(options);
AudioRecord.on('data', data => {
const chunk = Buffer.from(data, 'base64');
console.log('chunk size', chunk.byteLength);
// do something with audio chunk
});
How can I decode the variable chunk to PCM? As far as stated in another forum, this chunk does not include the headerBytes of the .wav File.