Adding some audio tests for new OpenALcode
This commit is contained in:
@@ -27,6 +27,7 @@
|
||||
|
||||
<source path="src" />
|
||||
|
||||
<haxelib name="lime" />
|
||||
<haxelib name="lime" />
|
||||
<haxelib name="actuate" />
|
||||
|
||||
</project>
|
||||
@@ -11,6 +11,8 @@ import lime.gl.GLProgram;
|
||||
import lime.utils.Float32Array;
|
||||
import lime.geometry.Matrix3D;
|
||||
|
||||
import motion.Actuate;
|
||||
|
||||
class Main {
|
||||
|
||||
public var lib : LiME;
|
||||
@@ -34,7 +36,18 @@ class Main {
|
||||
lib = _lime;
|
||||
|
||||
// Init the shaders and view
|
||||
init();
|
||||
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();
|
||||
|
||||
// Actuate.timer (0.5).repeat ().onRepeat(function(){
|
||||
// lib.audio.sounds.get('sound2').play();
|
||||
// });
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -82,7 +82,7 @@ class AudioHandler {
|
||||
var _sound = new Sound(_handle);
|
||||
sounds.set(_name, _sound);
|
||||
}
|
||||
|
||||
|
||||
|
||||
private static var nme_sound_from_file = Libs.load("nme","nme_sound_from_file", 2);
|
||||
private static var nme_sound_from_data = Libs.load("nme","nme_sound_from_data", 3);
|
||||
|
||||
@@ -266,8 +266,6 @@ class LiME {
|
||||
|
||||
do_render(_event);
|
||||
|
||||
//make sure the c++ knows our sleep time
|
||||
render.next_wake();
|
||||
|
||||
} // if !has_shutdown
|
||||
|
||||
@@ -288,6 +286,9 @@ class LiME {
|
||||
}
|
||||
|
||||
render.render();
|
||||
//make sure the c++ knows our sleep time
|
||||
// render.next_wake();
|
||||
|
||||
|
||||
} //do_render
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user