hyperandroid / CAAT

Canvas Advanced Animation Toolkit
hyperandroid.github.com/CAAT
MIT License
727 stars 117 forks source link

Sound functions like pause, set volume #111

Open radzikowski opened 11 years ago

radzikowski commented 11 years ago

Hi

CAAT has no operations in the playback sound, you can not just set stop/pause of playing sound, or even change the volume on it. You can change volume before you play a sound.

hyperandroid commented 11 years ago

I've made Audio functions:

director.audioPlay director.audioLoop director.musicPlay

to return the assigned Audio object. You can then modify the volume on the fly through out the returned object.

stop/pause, is not intended to be done on your side. You instrument the system to start playing/looping a sound. Mainly because it reuses Audio channels. You could stop a sound though without problem.

additionally, you can set a callback for the event of a sound end playing.

you can pause the music with the Audio object returned by director.musicPlay.

Is this the expected behavior ?

Thanks.

2013/1/3 Piotr Radzikowski notifications@github.com

Hi

CAAT has no operations in the playback sound, you can not just set stop/pause of playing sound, or even change the volume on it. You can change volume before you play a sound.

— Reply to this email directly or view it on GitHubhttps://github.com/hyperandroid/CAAT/issues/111.