Open Artotim opened 9 months ago
Hi, first of all, this package currently only works on Android. If you try to get voice data from IOS it only returns not opus converted data and you can save it to WAV format.
Hello @Mithronn, thanks for the answer. About saving raw data I've been trying to append Wav headers to it and save, but without success. But for the opus converted data in android, can i save it and read it outside Android?
Base64 encoded raw_data
needs to be decoded before appending WAV headers. The opus data can be used similarly to raw_data
after decoding.
RNRealTimeAudioStream.on("data", data => {
RNFS.writeFile(`${ExternalCachesDirectoryPath}/test-audio-opus-${new Date().getTime()}`, Buffer.from(data.opus_data, 'base64'))
.then(() => console.log("wrote"))
.catch(err => console.log(err));
});
Hello, I'm trying to use this package to save audio in real time. What I'm trying to do is to save the opus_data from the
data
event and try to load it elsewhere. But I'm not being able to read it with any player, ffmpeg also throws an error.So how can one save the contents from data in a file to be listened to later?