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

MediaStream from Web RTC API as a data source? #44

Open japboy opened 11 years ago

japboy commented 11 years ago

Just wondering if it's possible or not...?

jsantell commented 11 years ago

Not in the current implementation -- in the next version, yes, and this is something I'd like to see!

japboy commented 11 years ago

Cool! Looking forward to it :+1:

hampusohlsson commented 10 years ago

Any updates on this?

jsantell commented 10 years ago

This project as a whole needs to be revamped to support the current state of web audio, which is now much different than it was two years ago... have been investigating best way to go about it, which will include all these new sources though :)

hampusohlsson commented 10 years ago

@jsantell What are your thoughts? I'll be happy to help/contribute.

theunknownartisthour commented 9 years ago

Not 100% certain if this'll help, but you might consider https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API/Visualizations_with_Web_Audio_API#Creating_a_frequency_bar_graph

This is currently cross compatible between firefox and chrome and uses a microphone, which I assume is at least partially similar to a live-stream, may be helpful.

Speaking of: if you update the adapterWebAudio.js with some try catch you'll find Chrome supports live-streams.

  this.audio.addEventListener( 'progress', function ( e ) {
    if ( e.currentTarget.duration ) {
      try{/*e.currentTarget.seekable.end() doesn't exist for stream sources on chrome*/
        _this.progress = e.currentTarget.seekable.end( 0 ) / e.currentTarget.duration;
      } catch (e) {/*fake out progress bar movement*/
        _this.progress = 1;
      }
    }
  });

Not sure what to do the mozAdapter to have that work, I'm hoping to see live-streams being cross-compatible. I mean if the

I'd be incredibly interested to see this happen because I work at a radio station and it'd be pretty awesome to create visuals.