From a3cdb33f28fcbee40ec6904cab594568d3e5cf15 Mon Sep 17 00:00:00 2001 From: Marekkon5 Date: Thu, 29 Aug 2024 18:53:09 +0200 Subject: [PATCH] Fix Rodio version --- Cargo.lock | 45 ++++++++++++++++++-------- crates/onetagger-autotag/src/shazam.rs | 2 +- crates/onetagger-player/Cargo.toml | 2 +- crates/onetagger-player/src/aiff.rs | 1 + crates/onetagger-player/src/lib.rs | 3 ++ 5 files changed, 38 insertions(+), 15 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4c498c9a..f3454725 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2825,6 +2825,26 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" +[[package]] +name = "minimp3-sys" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e21c73734c69dc95696c9ed8926a2b393171d98b3f5f5935686a26a487ab9b90" +dependencies = [ + "cc", +] + +[[package]] +name = "minimp3_fixed" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42b0f14e7e75da97ae396c2656b10262a3d4afa2ec98f35795630eff0c8b951b" +dependencies = [ + "minimp3-sys", + "slice-ring-buffer", + "thiserror", +] + [[package]] name = "miniz_oxide" version = "0.7.4" @@ -4370,6 +4390,7 @@ dependencies = [ "cpal", "hound", "lewton", + "minimp3_fixed", "symphonia", "thiserror", ] @@ -4789,6 +4810,17 @@ dependencies = [ "autocfg", ] +[[package]] +name = "slice-ring-buffer" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84ae312bda09b2368f79f985fdb4df4a0b5cbc75546b511303972d195f8c27d6" +dependencies = [ + "libc", + "mach2", + "winapi", +] + [[package]] name = "smallvec" version = "1.13.2" @@ -4948,25 +4980,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "815c942ae7ee74737bb00f965fa5b5a2ac2ce7b6c01c0cc169bbeaf7abd5f5a9" dependencies = [ "lazy_static", - "symphonia-bundle-mp3", "symphonia-codec-aac", "symphonia-core", "symphonia-format-isomp4", "symphonia-metadata", ] -[[package]] -name = "symphonia-bundle-mp3" -version = "0.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c01c2aae70f0f1fb096b6f0ff112a930b1fb3626178fba3ae68b09dce71706d4" -dependencies = [ - "lazy_static", - "log", - "symphonia-core", - "symphonia-metadata", -] - [[package]] name = "symphonia-codec-aac" version = "0.5.4" diff --git a/crates/onetagger-autotag/src/shazam.rs b/crates/onetagger-autotag/src/shazam.rs index ef01a019..5556f920 100644 --- a/crates/onetagger-autotag/src/shazam.rs +++ b/crates/onetagger-autotag/src/shazam.rs @@ -1,7 +1,7 @@ use anyhow::Error; use std::path::Path; use std::thread::Builder; -use rodio::source::UniformSourceIterator; +use onetagger_player::rodio::source::UniformSourceIterator; use serde::{Serialize, Deserialize}; use songrec::SignatureGenerator; use onetagger_player::AudioSources; diff --git a/crates/onetagger-player/Cargo.toml b/crates/onetagger-player/Cargo.toml index d77f7cef..28e46f2b 100644 --- a/crates/onetagger-player/Cargo.toml +++ b/crates/onetagger-player/Cargo.toml @@ -14,5 +14,5 @@ anyhow = "1.0" pacmog = "0.4.2" mp4parse = "0.17" -rodio = { version = "0.19", features = ["symphonia-aac", "symphonia-isomp4", "symphonia-mp3"] } +rodio = { version = "0.19", features = ["symphonia-aac", "symphonia-isomp4", "flac", "vorbis", "wav", "minimp3"], default-features = false } diff --git a/crates/onetagger-player/src/aiff.rs b/crates/onetagger-player/src/aiff.rs index 66ba7709..0e464b7f 100644 --- a/crates/onetagger-player/src/aiff.rs +++ b/crates/onetagger-player/src/aiff.rs @@ -65,6 +65,7 @@ impl AIFFDecoder { let specs = reader.get_pcm_specs(); // Decode the file (because the library is weeeird) + // TODO: Make better using symphonia / new rodio let mut samples = vec![0i16; specs.num_channels as usize * specs.num_samples as usize]; let mut i = 0; for sample in 0..specs.num_samples { diff --git a/crates/onetagger-player/src/lib.rs b/crates/onetagger-player/src/lib.rs index de15f201..1cf8606f 100644 --- a/crates/onetagger-player/src/lib.rs +++ b/crates/onetagger-player/src/lib.rs @@ -17,6 +17,9 @@ pub mod alac; pub mod flac; pub mod aiff; +/// Re-Export to prevent dependency issues +pub use rodio; + pub struct AudioPlayer { tx: Sender, rx: Receiver,