From 0012b7c4478f0aa6215199ccb3c0e3cc4faa27cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E7=9A=93?= Date: Thu, 4 Jul 2024 11:37:46 -0400 Subject: [PATCH] Initialize `Audio` lazily in web builds --- 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