I thought I'd tell you all that I've worked a bit with Emscripten lately, and managed to port theXiph.org OGG/Vorbis demuxer and decoder using Emscripten.The example is here:
It works in some browsers, but for example in Safari 5.1.7 (latest available on Windows),I get an error:INVALID_STATE_ERR: DOM Exception 11: An attempt was made to use an object that is not, or is no longer, usable.Does anyone know how to debug that?
On Sun, Oct 16, 2016 at 3:57 PM, Morten W. Petersen <mor...@gmail.com> wrote:I thought I'd tell you all that I've worked a bit with Emscripten lately, and managed to port theXiph.org OGG/Vorbis demuxer and decoder using Emscripten.The example is here:Nice!
You might also want to check out my ogv.js project, which plays audio and video from Ogg and WebM files: https://github.com/brion/ogv.js
It works in some browsers, but for example in Safari 5.1.7 (latest available on Windows),I get an error:INVALID_STATE_ERR: DOM Exception 11: An attempt was made to use an object that is not, or is no longer, usable.Does anyone know how to debug that?Safari for Windows is long-abandoned and isn't representative of Safari on Mac or iOS, unfortunately. To test how things work for actual Safari users you'll need to track down a Mac or iOS device. I can confirm it seems to work in Safari Technical Preview on macOS 10.12.
On Monday, October 17, 2016 at 5:43:31 PM UTC+2, Brion Vibber wrote:On Sun, Oct 16, 2016 at 3:57 PM, Morten W. Petersen <mor...@gmail.com> wrote:I thought I'd tell you all that I've worked a bit with Emscripten lately, and managed to port theXiph.org OGG/Vorbis demuxer and decoder using Emscripten.The example is here:Nice!Thanks. :)You might also want to check out my ogv.js project, which plays audio and video from Ogg and WebM files: https://github.com/brion/ogv.jsYes I did have a look at that as a possible solution for me, but I think I found it too big a project,as I'm aiming squarely at audio. At some point I'd like to make decoding a lot faster than whatit is now.
I'd like to hear how you handle decoding, buffering etc. though - as performance is acceptableif 10-second chunks are decoded at a time for example.
Safari for Windows is long-abandoned and isn't representative of Safari on Mac or iOS, unfortunately. To test how things work for actual Safari users you'll need to track down a Mac or iOS device. I can confirm it seems to work in Safari Technical Preview on macOS 10.12.Yep.I did find a list of WebKit-based browsers here:I think testing against one of those will be good enough for a while, as Floh reported the player didwork on Safari now (without me having done any testing against it).
On Monday, October 17, 2016, Morten W. Petersen <mor...@gmail.com> wrote:On Monday, October 17, 2016 at 5:43:31 PM UTC+2, Brion Vibber wrote:On Sun, Oct 16, 2016 at 3:57 PM, Morten W. Petersen <mor...@gmail.com> wrote:I thought I'd tell you all that I've worked a bit with Emscripten lately, and managed to port theXiph.org OGG/Vorbis demuxer and decoder using Emscripten.The example is here:Nice!Thanks. :)You might also want to check out my ogv.js project, which plays audio and video from Ogg and WebM files: https://github.com/brion/ogv.jsYes I did have a look at that as a possible solution for me, but I think I found it too big a project,as I'm aiming squarely at audio. At some point I'd like to make decoding a lot faster than whatit is now.Yeah you can make some different trade offs if you're aimed at smaller audio clips. :)
I'd like to hear how you handle decoding, buffering etc. though - as performance is acceptableif 10-second chunks are decoded at a time for example.I'm decoding in realtime (a few packets at a time), maintaining about a 1 second buffer-ahead for audio. The output is done via Web Audio except on Internet Explorer which uses a Flash shim. This involves jumping through some hoops but works well for long streams and synchronization with the video.Most of my logic is on the JavaScript side, with just demuxer and decoders in emscripten. For audio, decoding is driven by the Web Audio ScriptProcessorNode requesting additional data so this works even in a background tab (video currently uses timers which get throttled, though).I'm also running decode operations in a Worker thread, so audio decode, video decode, and playback can run simultaneously. Workers are quite well supported these days, even on Internet explorer 11... This might be a good way to halve your decode time if you can split up the file fairly cleanly into alternating chunks -- dual-core CPUs are virtually everywhere now.Feel free to follow up in more detail offlist if you like. :) I'm hoping to make the logic side a little lighter weight and make it work better for the short audio case too, but I can definitely see some advantages to the pre-decoded method you're using.
Safari for Windows is long-abandoned and isn't representative of Safari on Mac or iOS, unfortunately. To test how things work for actual Safari users you'll need to track down a Mac or iOS device. I can confirm it seems to work in Safari Technical Preview on macOS 10.12.Yep.I did find a list of WebKit-based browsers here:I think testing against one of those will be good enough for a while, as Floh reported the player didwork on Safari now (without me having done any testing against it).Excellent... beware that iOS safari can be a little different than the rest in terms of media playback, so try to test it too!