chris-rudmin / opus-recorder

A library for encoding and decoding web audio as OggOpus.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Play pages real-time

MAminnn opened this issue · comments

commented

Hi, as you mentioned in your document if we set streamPages to true then ondataavailable will be called for each recorded page at the time.
I wonder how I can play this data, the way you did play recorded audio after a while,was is by making a blob and passing it to an audio element to play, but it can't be done with some audio samples whose durations are so limited, actually, I tried to do that but nothing played, I think it's because the process to play with this method is not fast enough.
Anyway, I also tried to play it with AudioBufferSourceNode but the result was nothing but static meaningless noises
could you show me a way to play these pages (I'm not sure we can call them samples or not) in real-time?
thank you!

I've never done such a thing. The stream pages flag was intended for streaming the data to a server (and not with the intention of playing the stream back in the client where it was recorded). If you figure it out, let us know how here. :). good luck.

If you want realtime audio, just enable monitoring, and you will hear the stream in real time.