1
0
Fork 0
mirror of https://github.com/librespot-org/librespot.git synced 2025-10-03 17:59:24 +02:00
This commit is contained in:
Celeste Peláez 2025-10-01 12:39:18 +01:00 committed by GitHub
commit 7fa143f218
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 20 additions and 2 deletions

13
Cargo.lock generated
View file

@ -3539,6 +3539,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "815c942ae7ee74737bb00f965fa5b5a2ac2ce7b6c01c0cc169bbeaf7abd5f5a9"
dependencies = [
"lazy_static",
"symphonia-bundle-flac",
"symphonia-bundle-mp3",
"symphonia-codec-vorbis",
"symphonia-core",
@ -3546,6 +3547,18 @@ dependencies = [
"symphonia-metadata",
]
[[package]]
name = "symphonia-bundle-flac"
version = "0.5.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "72e34f34298a7308d4397a6c7fbf5b84c5d491231ce3dd379707ba673ab3bd97"
dependencies = [
"log",
"symphonia-core",
"symphonia-metadata",
"symphonia-utils-xiph",
]
[[package]]
name = "symphonia-bundle-mp3"
version = "0.5.4"

View file

@ -85,6 +85,7 @@ symphonia = { version = "0.5", default-features = false, features = [
"mp3",
"ogg",
"vorbis",
"flac"
] }
# Legacy Ogg container decoder for the passthrough decoder

View file

@ -10,8 +10,8 @@ use symphonia::{
meta::{StandardTagKey, Value},
},
default::{
codecs::{MpaDecoder, VorbisDecoder},
formats::{MpaReader, OggReader},
codecs::{FlacDecoder, MpaDecoder, VorbisDecoder},
formats::{FlacReader, MpaReader, OggReader},
},
};
@ -48,6 +48,8 @@ impl SymphoniaDecoder {
Box::new(OggReader::try_new(mss, &format_opts)?)
} else if AudioFiles::is_mp3(file_format) {
Box::new(MpaReader::try_new(mss, &format_opts)?)
} else if AudioFiles::is_flac(file_format) {
Box::new(FlacReader::try_new(mss, &format_opts)?)
} else {
return Err(DecoderError::SymphoniaDecoder(format!(
"Unsupported format: {file_format:?}"
@ -63,6 +65,8 @@ impl SymphoniaDecoder {
Box::new(VorbisDecoder::try_new(&track.codec_params, &decoder_opts)?)
} else if AudioFiles::is_mp3(file_format) {
Box::new(MpaDecoder::try_new(&track.codec_params, &decoder_opts)?)
} else if AudioFiles::is_flac(file_format) {
Box::new(FlacDecoder::try_new(&track.codec_params, &decoder_opts)?)
} else {
return Err(DecoderError::SymphoniaDecoder(format!(
"Unsupported decoder: {file_format:?}"