jsantell / dancer.js

high-level audio API, designed to make sweet visualizations
jsantell.github.com/dancer.js
MIT License
2.11k stars 211 forks source link

sounds glitches after change of audio src #42

Open lapsio opened 11 years ago

lapsio commented 11 years ago

I'm trying to use dancer with js music player, but when it changes source file everything sounds crappy. I've also tried to do this manually via chrome console in example file attached in dancer douwnload, but I've achieved the same crappy efect either when I've changed src during playback or when playback was paused. Is there any way to walk around this issue, like destroy and create new dancer? or maybe reload somehow.

mehrdd commented 11 years ago

i have the same issue with dancer.js i'm using jPlayer with dancer.js and everytime my playlist gets change, the song will play crappy ..

thank you.

lapsio commented 11 years ago

everyone is and will be having this issue until google won't fix this - in fact it's not dancer fault at all. Audio element used by processor to get waveform is permanently corrupted by it after connection and no longer able to be reused. So you won't be able to use neither dancer nor any other player using single audio element for all songs. On our site we've made custom player which creates new Audio() for every loaded track. I'm not sure if it's possible to walkaround both in jPlayer and dancer to use brand new audio elements, i guess It'd be more reasonable to code own player, or at least make some wrapper basing on jPlayer events to use external audio elements.

Generally it needs more serious changes in dancer. I wouldn't be so sure if theese will come frequently.