Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MP3 Streaming Support #10

Open
oampo opened this issue Aug 10, 2011 · 7 comments
Open

MP3 Streaming Support #10

oampo opened this issue Aug 10, 2011 · 7 comments
Labels

Comments

@oampo
Copy link
Owner

oampo commented Aug 10, 2011

Using mp3.js. Would need some sort of streaming buffer support probably.

@oampo
Copy link
Owner Author

oampo commented Aug 22, 2011

Waiting for aurora.js to get released before working on this. That should fulfil pretty much all of my streaming needs, and be easier to integrate than mp3.js.

@oampo oampo closed this as completed Aug 22, 2011
@oampo oampo reopened this Aug 22, 2011
@zz85
Copy link

zz85 commented Nov 29, 2011

there's also https://github.com/nddrylliog/jsmad too for royalty free mp3 decoding in JS. btw, there's also an updated version of sink.js

@oampo
Copy link
Owner Author

oampo commented Nov 30, 2011

Oops - when I said mp3.js I mean jsmad. According to the nice folks behind jsmad (who are also developing aurora.js), jsmad is too tightly coupled to its own buffering and output code to be at all friendly to integrate with Audiolet. aurora.js is designed to fix this (and a whole host of other) issue, so their best advice is to wait.

I pulled the latest sink.js to master though - cheers for the heads-up.

@tambien
Copy link

tambien commented Jan 12, 2012

has there been any progress on this issue? i am working on an ambitious multitrack audio player and it is unreasonable to use wavs for everything (4 tracks @ 4:00 each is >100MB).

any progress on aurora.js?

thanks for the great work and the great library.

@oampo
Copy link
Owner Author

oampo commented Jan 12, 2012

Still waiting I'm afraid - the ofmlabs folks are busy. You can track progress on aurora.js at https://github.com/JensNockert/aurora.js. As a stopgap you might find something based on https://gist.github.com/1599851 useful. It's Web Audio API only so won't work in Firefox, but if that's not an issue then it will probably work okay. Be warned though that it is pretty hacky and not very well tested, so ymmv.

@tambien
Copy link

tambien commented Jan 12, 2012

cool! this is a good start. thanks.

looking through some of the documentation, both Firefox and Chrome support OGG out of the box. it doesn't seem like it would be too much effort to expand your WebKitBufferPlayer into a general "OggBufferPlayer" that could work in both browsers. that would be a really useful shim until the ofmlabs people release their panacean codec library.

@oampo
Copy link
Owner Author

oampo commented Jan 16, 2012

@tambien It's actually not quite as simple as that, as the WebKitBufferPlayer code relies on the Web Audio API to do the decoding and streaming. However, the approach of having what is essentially a FIFO buffer in the JavaScript holding (hopefully) enough data that we don't get underrruns may be applicable to the Audio Data API too. In theory you could replace the JavaScriptNode onaudioprocess event with the Audio Data API's mozAudioAvailable event (see https://wiki.mozilla.org/Audio_Data_API#Reading_Audio), and you might have a working cross-platform solution, albeit a very limited, and stupendously ugly one...

If you want to have a go at getting it working I'd firstly try to copy the WebKitBufferPlayer code and swap out the JavaScriptAudioNode for a <audio> element using mozAudioAvailable, and call it something like MozillaBufferPlayer. If that works then you should be able to check the type of sink and use whichever version is appropriate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants