Audio on native
This commit is contained in:
@@ -15,8 +15,13 @@ export class WebAudioOutput implements SoundOutput {
|
||||
#buffers = new WeakMap<Uint8Array, Promise<AudioBuffer | undefined>>();
|
||||
#volumes: Volumes | undefined;
|
||||
|
||||
constructor() {
|
||||
// browsers keep audio off until the player clicks or presses a key, so it starts then
|
||||
// browsers keep audio off until the player clicks or presses a key, so it starts then. the desktop app's web audio
|
||||
// (client/native/web_audio.ts) has no such rule and starts right away
|
||||
constructor(wait_for_input = true) {
|
||||
if (!wait_for_input) {
|
||||
this.#unlock();
|
||||
return;
|
||||
}
|
||||
const unlock = () => {
|
||||
this.#unlock();
|
||||
if (this.#context?.state === "running") {
|
||||
|
||||
Reference in New Issue
Block a user