Open meherhowji opened 1 year ago
At bit16 sample code
const S16_MAX = 2 ** 15
const buffer = Buffer.from(data, 'base64')
const samples = new Float32Array(Array.from(
{ length: buffer.length / 2 },
(v, i) => buffer.readInt16LE(i * 2) / S16_MAX,
))
Thank you @hans00 for the code. I will plug this and test it out. 👍
Can you please explain, why this approach is not correct? I m also training to use the model but there so few documentation on how to do it in RN.
const float32Array = new Float32Array(audioBuffer.buffer)
Can you please explain, why this approach is not correct? I m also training to use the model but there so few documentation on how to do it in RN.
const float32Array = new Float32Array(audioBuffer.buffer)
The source data is S16 not F32
What change would you recommend if I want to add a new data format as Float32Array, currently what's returned is base64. I am trying to feed this data to a trained model and would like to avoid the conversion if natively I can fetch such a format.