play-co / devkit

HTML 5 game platform for browser and mobile
http://docs.gameclosure.com
627 stars 126 forks source link

AudioManager > Various issues in Simulator and Native #212

Open oodavid opened 9 years ago

oodavid commented 9 years ago

Numerous issues with AudioManager spanning the Simulator, Native and Documentation.

I've knocked up a demo app so you can test these issues against it. Feel free to pack it up and use it in the documentation.

The MusicTest Repo (click me!) Sample App

Simulator

Nota Bene - @collingreen said that volume doesn't work on android and that passing "time" doesn't work on iOS...

iOS

On the subject of units, I think milliseconds would be a sensible choice over seconds. I know setTime requires seconds from reading through the sources, however the documentation doesn't specify units and the methods appear to be inconsistent. Logic: animate, tick, setInterval and setTimeout all use milliseconds. (let's just ignore the weird javascript's date timestamp thing)

oodavid commented 9 years ago

Feature Request: play to have additional "volume" option.

This logically redact this code:

audio.setVolume('sfx', 0.5);
audio.play('sfx', { time: 1000, duration: 500 });

to

audio.play('sfx', { time: 1000, duration: 500, volume: 0.5 });