Checking different sources I learnt that HTML5 DOES support setting the playrate of a given video/audio from JS code. So after some tinkering I got it working on Monkey.
You need to locate the following function in Mojos's native implementation for HML5 (mojo.html5.js):
gxtkAudio.prototype.SetRate=function( channel,rate ){
var chan=this.channels[channel];
chan.rate=rate;
}
And edit the "chan.rate="rate" line so the function looks like this:
gxtkAudio.prototype.SetRate=function( channel,rate ){
var chan=this.channels[channel];
if (chan.audio && chan.audio.playbackRate) chan.audio.playbackRate=rate;
}
The only "problem" I've found so far is that values below 0.5 don't seem to work. (at least for the sound file and browser I used for testing. Perhaps it works in the full range of values with other -higher quality- sound files or other browsers).
|