Update Files

This commit is contained in:
2025-01-22 16:18:30 +01:00
parent ed4603cf95
commit a36294b518
16718 changed files with 2960346 additions and 0 deletions

View File

@ -0,0 +1,32 @@
package kha.js;
import js.Syntax;
import js.html.audio.AudioContext;
@:keep
class MobileWebAudio {
@:noCompletion public static var _context: AudioContext;
@:noCompletion public static function _init(): Void {
try {
_context = new AudioContext();
return;
}
catch (e:Dynamic) {}
try {
Syntax.code("this._context = new webkitAudioContext();");
return;
}
catch (e:Dynamic) {}
}
public static function play(sound: Sound, loop: Bool = false): kha.audio1.AudioChannel {
var channel = new MobileWebAudioChannel(cast sound, loop);
channel.play();
return channel;
}
public static function stream(sound: Sound, loop: Bool = false): kha.audio1.AudioChannel {
return play(sound, loop);
}
}