From 90f6ec9930ee40b9ca381edccc82387e6050a6fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E7=9A=93?= Date: Thu, 4 Jul 2024 15:21:48 -0400 Subject: [PATCH] Initialize `Audio` lazily in web builds (#137) --- crates/audio/src/wrapper.rs | 21 +++++++++++++++++---- src/main.rs | 2 +- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/crates/audio/src/wrapper.rs b/crates/audio/src/wrapper.rs index cb5bd827..9e7afd76 100644 --- a/crates/audio/src/wrapper.rs +++ b/crates/audio/src/wrapper.rs @@ -72,8 +72,8 @@ enum AudioWrapperCommandInner { } impl AudioWrapper { - pub fn new(audio: Audio) -> Self { - audio.into() + pub fn new() -> Self { + Default::default() } pub fn play( @@ -155,9 +155,15 @@ impl AudioWrapper { } } -impl From