jsantell / dancer.js

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

Music plays too fast on ubuntu chrome #35

Open dikkietrom opened 11 years ago

dikkietrom commented 11 years ago

Other webaudio demos dont have this problem so it seems to be something in dancer.js

jsantell commented 11 years ago

Hmm, guessing it's the sample rate -- what version of Chrome and Ubuntu?

dikkietrom commented 11 years ago

Hi Jordan,

Chrome Version 21.0.1180.89 Ubuntu DISTRIB_ID=Ubuntu DISTRIB_RELEASE=12.04 DISTRIB_CODENAME=precise DISTRIB_DESCRIPTION="Ubuntu 12.04.1 LTS"

Ubuntu 32 bit version that is. Is there anything I can try out?

Thanks, Dennis

On Tue, Oct 23, 2012 at 10:56 PM, Jordan Santell notifications@github.comwrote:

Hmm, guessing it's the sample rate -- what version of Chrome and Ubuntu?

— Reply to this email directly or view it on GitHubhttps://github.com/jsantell/dancer.js/issues/35#issuecomment-9717894.

jsantell commented 11 years ago

Great thank you, will look into it!

dikkietrom commented 11 years ago

for the time being I was doing this and get the same too fast playing thing. But when I remove the first connect the file plays fine and the analyser seems connected also. I dont see analyser used in your code but maybe it gives you a clue somehow.

    var playAudioFile = function (buffer) {
        var source = context.createBufferSource();
        source.buffer = buffer;
        source.connect(context.destination);                   <---------- first connect

        var analyser = context.createAnalyser();
        analyser.fftSize = 2048; // 2048-point FFT
        source.connect(analyser);                                <---------- 2nd connect
        analyser.connect(context.destination);

        source.noteOn(0); // Play sound immediately

    };
jsantell commented 11 years ago

No analyser, but there is a javascriptnode which may produce similar weirdness -- doing a large refactor and will definitely scope this out!

shoofle commented 11 years ago

I've encountered this problem too - at first I thought I was doing something wrong, but then I compared and found out that it did it in the dancer.js example too.