Stub some additional functionality for audio
This commit is contained in:
@@ -486,15 +486,13 @@ class Assets {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private static function isValidAudio (audio:AudioBuffer):Bool {
|
private static function isValidAudio (buffer:AudioBuffer):Bool {
|
||||||
|
|
||||||
#if (tools && !display)
|
#if (tools && !display)
|
||||||
#if (cpp || neko)
|
|
||||||
|
|
||||||
return true;
|
return (buffer != null);
|
||||||
//return (sound.__handle != null && sound.__handle != 0);
|
//return (sound.__handle != null && sound.__handle != 0);
|
||||||
|
|
||||||
#end
|
|
||||||
#end
|
#end
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -38,6 +38,13 @@ class AudioBuffer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function dispose ():Void {
|
||||||
|
|
||||||
|
// TODO
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public static function fromBytes (bytes:ByteArray):AudioBuffer {
|
public static function fromBytes (bytes:ByteArray):AudioBuffer {
|
||||||
|
|
||||||
#if (cpp || neko)
|
#if (cpp || neko)
|
||||||
@@ -80,6 +87,13 @@ class AudioBuffer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static function fromURL (url:String, handler:AudioBuffer->Void):Void {
|
||||||
|
|
||||||
|
// TODO
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#if (cpp || neko)
|
#if (cpp || neko)
|
||||||
private static var lime_audio_load:Dynamic = System.load ("lime", "lime_audio_load", 1);
|
private static var lime_audio_load:Dynamic = System.load ("lime", "lime_audio_load", 1);
|
||||||
#end
|
#end
|
||||||
|
|||||||
@@ -1,13 +1,18 @@
|
|||||||
package lime.media;
|
package lime.media;
|
||||||
|
|
||||||
|
|
||||||
|
import lime.app.Event;
|
||||||
import lime.media.openal.AL;
|
import lime.media.openal.AL;
|
||||||
|
|
||||||
|
|
||||||
class AudioSource {
|
class AudioSource {
|
||||||
|
|
||||||
|
|
||||||
|
public var onComplete = new Event<Void->Void> ();
|
||||||
|
|
||||||
public var buffer:AudioBuffer;
|
public var buffer:AudioBuffer;
|
||||||
|
public var gain (get, set):Float;
|
||||||
|
public var timeOffset (get, set):Int;
|
||||||
|
|
||||||
private var id:UInt;
|
private var id:UInt;
|
||||||
|
|
||||||
@@ -114,4 +119,47 @@ class AudioSource {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Get & Set Methods
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private function get_gain ():Float {
|
||||||
|
|
||||||
|
// TODO
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private function set_gain (value:Float):Float {
|
||||||
|
|
||||||
|
// TODO
|
||||||
|
|
||||||
|
return value;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private function get_timeOffset ():Int {
|
||||||
|
|
||||||
|
// TODO
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private function set_timeOffset (value:Int):Int {
|
||||||
|
|
||||||
|
// TODO
|
||||||
|
|
||||||
|
return value;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user