anthumchris / opus-stream-decoder

Instantly decode Ogg Opus audio streams in chunks with JavaScript & WebAssembly (Wasm)
125 stars 21 forks source link

Mono #21

Closed ktb92677 closed 3 years ago

ktb92677 commented 3 years ago

What happens if the opus stream is in mono? Which channel should I use left or right?

anthumchris commented 3 years ago

I honestly don't remember if mono was tested with this or not. I do remember that you'll always get decoded stereo float samples back though.

ktb92677 commented 3 years ago

So the decoder always returns a left and right channel... since the audio is in mono will using either one work?

anthumchris commented 3 years ago

Unfortunately, I'm not sure and it's been a couple years since I tested with files. I would encourage you to test with a mono/stereo file to see what happens. I won't have time to do that unfortunately.

atulbari-samespace commented 3 years ago

@ktb92677 How to play received left and right buffer in browser?? In onDecode, I tried with audio element as audioelement.src = left; audioelement.load()

anthumchris commented 3 years ago

@atulbari-samespace Hi there. This repo is a WebAssembly module, and I recommend using the StackOverflow web-audio-api tag to post questions and search answers. Sorry I can't be of much help here!