Update Files
This commit is contained in:
17
Kha/Sources/kha/audio1/Audio.hx
Normal file
17
Kha/Sources/kha/audio1/Audio.hx
Normal file
@ -0,0 +1,17 @@
|
||||
package kha.audio1;
|
||||
|
||||
import kha.Sound;
|
||||
|
||||
extern class Audio {
|
||||
/**
|
||||
* Plays a sound immediately.
|
||||
* @param sound
|
||||
* The sound to play
|
||||
* @param loop
|
||||
* Whether or not to automatically loop the sound
|
||||
* @return A channel object that can be used to control the playing sound. Please be a ware that Null is returned when the maximum number of simultaneously played channels was reached.
|
||||
*/
|
||||
public static function play(sound: Sound, loop: Bool = false): AudioChannel;
|
||||
|
||||
public static function stream(sound: Sound, loop: Bool = false): kha.audio1.AudioChannel;
|
||||
}
|
17
Kha/Sources/kha/audio1/AudioChannel.hx
Normal file
17
Kha/Sources/kha/audio1/AudioChannel.hx
Normal file
@ -0,0 +1,17 @@
|
||||
package kha.audio1;
|
||||
|
||||
interface AudioChannel {
|
||||
function play(): Void;
|
||||
function pause(): Void;
|
||||
function stop(): Void;
|
||||
var length(get, null): Float; // Seconds
|
||||
private function get_length(): Float;
|
||||
var position(get, set): Float; // Seconds
|
||||
private function get_position(): Float;
|
||||
private function set_position(value: Float): Float;
|
||||
var volume(get, set): Float;
|
||||
private function get_volume(): Float;
|
||||
private function set_volume(value: Float): Float;
|
||||
var finished(get, null): Bool;
|
||||
private function get_finished(): Bool;
|
||||
}
|
Reference in New Issue
Block a user