From ec4a0f866a2ed5152094b14df01e2dd8d86dc7aa Mon Sep 17 00:00:00 2001 From: white-axe Date: Mon, 9 Oct 2023 14:26:03 +0000 Subject: [PATCH] Re-add rodio as a dependency in web builds --- Cargo.lock | 98 ++++++++++++++++++++++++++++++++++++++++++++++++++++-- Cargo.toml | 9 +++++ 2 files changed, 105 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 57ffd215..e3328af7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -995,8 +995,7 @@ dependencies = [ [[package]] name = "cpal" version = "0.15.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d959d90e938c5493000514b446987c07aed46c668faaa7d34d6c7a67b1a578c" +source = "git+https://github.com/DouglasDwyer/cpal.git?rev=91aeb4d6b02c25791f636fdf92a73637597c077a#91aeb4d6b02c25791f636fdf92a73637597c077a" dependencies = [ "alsa", "core-foundation-sys 0.8.4", @@ -4507,9 +4506,28 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "62e48dba70095f265fdb269b99619b95d04c89e619538138383e63310b14d941" dependencies = [ "lazy_static", + "symphonia-bundle-flac", "symphonia-bundle-mp3", + "symphonia-codec-aac", + "symphonia-codec-adpcm", + "symphonia-codec-pcm", + "symphonia-codec-vorbis", + "symphonia-core", + "symphonia-format-isomp4", + "symphonia-format-wav", + "symphonia-metadata", +] + +[[package]] +name = "symphonia-bundle-flac" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f23b0482a7cb18fcdf9981ab0b78df800ef0080187d294650023c462439058d" +dependencies = [ + "log", "symphonia-core", "symphonia-metadata", + "symphonia-utils-xiph", ] [[package]] @@ -4525,6 +4543,48 @@ dependencies = [ "symphonia-metadata", ] +[[package]] +name = "symphonia-codec-aac" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68bdd75b25ce4b84b12a4bd20bfea2460c2dbd7fc1d227ef5533504d3168109d" +dependencies = [ + "lazy_static", + "log", + "symphonia-core", +] + +[[package]] +name = "symphonia-codec-adpcm" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "870e7dc1865d818c7b6318879d060553a73a3b2a3b8443dff90910f10ac41150" +dependencies = [ + "log", + "symphonia-core", +] + +[[package]] +name = "symphonia-codec-pcm" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47f1fbd220a06a641c8ce2ddad10f5ef6ee5cc0c54d9044d25d43b0d3119deaa" +dependencies = [ + "log", + "symphonia-core", +] + +[[package]] +name = "symphonia-codec-vorbis" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3953397e3506aa01350c4205817e4f95b58d476877a42f0458d07b665749e203" +dependencies = [ + "log", + "symphonia-core", + "symphonia-utils-xiph", +] + [[package]] name = "symphonia-core" version = "0.5.3" @@ -4538,6 +4598,30 @@ dependencies = [ "log", ] +[[package]] +name = "symphonia-format-isomp4" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffdf14bae5cf352032416bc64151e5d6242d29d33cbf3238513b44d4427a1efb" +dependencies = [ + "encoding_rs", + "log", + "symphonia-core", + "symphonia-metadata", + "symphonia-utils-xiph", +] + +[[package]] +name = "symphonia-format-wav" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da76614728fa27c003bdcdfbac51396bd8fcbf94c95fe8e62f1d2bac58ef03a4" +dependencies = [ + "log", + "symphonia-core", + "symphonia-metadata", +] + [[package]] name = "symphonia-metadata" version = "0.5.3" @@ -4550,6 +4634,16 @@ dependencies = [ "symphonia-core", ] +[[package]] +name = "symphonia-utils-xiph" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a450ca645b80d69aff8b35576cbfdc7f20940b29998202aab910045714c951f8" +dependencies = [ + "symphonia-core", + "symphonia-metadata", +] + [[package]] name = "syn" version = "1.0.109" diff --git a/Cargo.toml b/Cargo.toml index 5a3116fe..1ec17589 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -109,6 +109,10 @@ poll-promise = { version = "0.3.0", features = ["web"] } tokio = { version = "1.32", features = ["sync"] } wasm-bindgen-futures = "0.4" indexed_db_futures = "0.3.0" +rodio = { version = "0.17.1", features = [ + "wasm-bindgen", + "symphonia-all", +], default-features = false } js-sys = "0.3" web-sys = { version = "0.3", features = [ "console", @@ -224,6 +228,11 @@ opt-level = 3 members = ["command-lib", "rmxp-types", "luminol-term"] [patch.crates-io] +# We need this for rodio to work in WebAssembly until +# https://github.com/RustAudio/cpal/pull/774 +# is merged. +cpal = { git = "https://github.com/DouglasDwyer/cpal.git", rev = "91aeb4d6b02c25791f636fdf92a73637597c077a" } + # If you want to use the bleeding edge version of egui and eframe: # egui = { git = "https://github.com/emilk/egui", branch = "master" } # eframe = { git = "https://github.com/emilk/egui", branch = "master" }