html5 - How do you change source in a web audio context -


i'm making game changes of it's object depending on music playing. after each song has ended want audio context load in new source , analyze that. whenever tried i've gotten error audio object or buffer can't called twice.

after researching learned ctx.createmediaelementsource(myhtml5audioel) lets create sourcenode takes source html5 object. able loop through different song.

however game need play/analyze 30 seconds "remote url" comes out of spotify api. might wrong ctx.createmediaelementsource(myhtml5audioel)does not allow analyze source on remote site.

also game needs work on mobile chrome, createmediaelementsource(myhtml5audioel) not seem work on.

i might on wrong path here main question is: how can switch remote songs urls in web audio api. being compatible mobile chrome.

thanks!

first, found out, can't set buffer again audiobuffersource. solution create new one. audiobuffersources intended light-weight objects can create , use.

second, in chrome 42 , newer, createmediaelementsource requires appropriate cors access have make sure remote url sends appropriate headers , set crossorigin attribute appropriately.

finally, mobile chrome not pass data audio element through createmediaelementsource.


Comments

Popular posts from this blog

Email notification in google apps script -

c++ - Difference between pre and post decrement in recursive function argument -

javascript - IE11 incompatibility with jQuery's 'readonly'? -