Fixing sound errors on html5

This commit is contained in:
underscorediscovery
2013-07-18 02:17:56 -02:30
parent f22ec427e0
commit 00cd4a95f2
2 changed files with 9 additions and 9 deletions

View File

@@ -36,13 +36,6 @@ class Main {
// Init the shaders and view
init();
lib.audio.create_sound('sound1', 'assets/music_credit.ogg');
lib.audio.create_sound('sound2', 'assets/shoot.wav');
lib.audio.sounds.get('sound1').volume = 1;
lib.audio.sounds.get('sound1').play();
lib.audio.sounds.get('sound2').play();
}

View File

@@ -36,12 +36,19 @@ class Sound {
public function play(?_loops:Int = 0, ?_start:Float = 0.0) {
sound = null;
sound = nme_sound_channel_create(handle, _start, _loops, _transform);
#if lime_native
sound = nme_sound_channel_create(handle, _start, _loops, _transform);
#end //lime_native
}
public function stop() {
if(sound != null) {
nme_sound_channel_stop(sound);
#if lime_native
nme_sound_channel_stop(sound);
#end //lime_native
sound = null;
}
}