confusion with web audio api and <audio> tag

23 views
Skip to first unread message

Gordon Hu

unread,
Jul 3, 2014, 12:48:24 PM7/3/14
to chromiu...@chromium.org
Hi,
I am a newbie to html5 web audio api.
I have been tasked recently to provide a scrubber for our audio player.
I planned on using <audio> tag and create event listener to capture the events.
However since the <audio> requires src but the src is streaming audio which is chopped into smaller chunks via mp3spltr.
Is there a solution where I can take a bumber of chopped up mp3 chunks created via web audio api like the following:

// create a sound source
soundSource = context.createBufferSource();
 
// The Audio Context handles creating source
// buffers from raw binary data
soundBuffer = context.createBuffer(audioData, true/*make mono*/);
 
// Add the buffered data to our object
soundSource.buffer = soundBuffer;


and somehow be able to listen to it with the native player created with the <audio> tag?

What exactly is the relationship between the <audio> tag and web audio api ?

Gordon
Reply all
Reply to author
Forward
0 new messages