eshaz/wasm-audio-decoders

Question: What is the expected input for the decoder

wojciak opened this issue · 2 comments

I'm passing a Uint8Array that contains encoded float32 values, but the decoder creates only pops with that, does it require int16 at the input? (opus audio decoder)

eshaz commented

How are you getting the data you're attempting to supply to the decoder? If you have an example that would help.

Here's the answer to your question. You can click on each header link below to read the docs which describes how the decoders should be used in more detail.

ogg-opus-decoder

If you are decoding an Ogg Opus file, the input is the raw binary data that is read from the file itself. The Uint8Array should contain the data read directly from the file. You can supply the data in chunks and the decoder will return chunks of decoded audio.

opus-decoder

If you are decoding Opus frames, you need to supply each individual frame as an array of Uint8Arrays to the decoder which is the raw binary data containing only Opus frames. opus-decoder assumes you have already split the file into frames from a container format such as Ogg, WEBM, MP4, etc.

eshaz commented

Closing due to inactivity.