Audio playback. This class wraps around kha.audio1.Audio.

Static methods

@:value({ stream : false, loop : false })staticplay(sound:Sound, loop:Bool = false, stream:Bool = false):Null<AudioChannel>

Plays the given sound.

If stream is true and the sound has compressed data, it is streamed from disk instead of being fully loaded into memory. This is useful for longer sounds such as background music.

This function returns null if:

  • there is no unoccupied audio channel available for playback.
  • the sound has compressed data only but stream is false. In this case, call kha.Sound.uncompress() first.

Constructor

new()