aduros / flambe

Rapidly cook up games for HTML5, Flash, Android, and iOS.
https://github.com/aduros/flambe/wiki
MIT License
745 stars 118 forks source link

Sound playback improvements - added optional offset and duration parameters #287

Open mikedotalmond opened 10 years ago

mikedotalmond commented 10 years ago

Adds ability to play or loop regions of a sound, with optional offset and duration parameters.

play (volume :Float = 1.0, offset:Float=0, duration:Float=0) :Playback loop (volume :Float = 1.0, offset:Float=0, duration:Float=0) :Playback

This will allow sound-sprite type behaviours - where many short sounds can be contained in, and played from, a single asset.

The update should be seamless across all platforms - and not break anything.. but I have changed how Playback objects are disposed:

mikedotalmond commented 10 years ago

Ah, I see I didn't update Mixer. Will fix.

mikedotalmond commented 10 years ago

Hmm, I see why those js.html.audio externs were left out... revert....

mikedotalmond commented 10 years ago

Build appears to have failed on a firefox.js test - timed out after 10 mins. Not sure why. https://travis-ci.org/aduros/flambe/jobs/32797267