birdofpreyru / react-native-audio

React Native: access to the audio input stream, and audio sample player
https://dr.pogodin.studio/docs/react-native-audio
Other
21 stars 4 forks source link

Question: Сhunks flow #20

Closed GemsGame closed 9 months ago

GemsGame commented 9 months ago

Hello! Can you clarify some questions? I got a Buffer and doing something like this


const chunks = [];

chunks.push(chunk);

const base64 = Buffer.concat(chunks).toString('base64');

and got a data MIME type: audio/octet-stream

How I can transfer this data to audio/wav for example? In the last step the data must looks like a data:audio/wav;base64,AAAAAAAAAAAAAA....

It's possible do it on the React Native or I must using a server & data transformers?

birdofpreyru commented 9 months ago

This library generates audio chunks in PCM format. How to convert PCM audio data into WAV format, and what is the best way to do it, I don't know out of my head.