1
0
Fork 0
mirror of https://github.com/librespot-org/librespot.git synced 2025-10-03 09:49:31 +02:00

feat: fallback to S16 format if unsupported in Rodio backend

This commit is contained in:
Roderick van Domburg 2025-08-13 13:27:16 +02:00
parent ce1ab8ff3f
commit fdd4a16fdc
No known key found for this signature in database
GPG key ID: 607FA06CB5236AE0

View file

@ -209,8 +209,10 @@ pub fn open(host: cpal::Host, device: Option<String>, format: AudioFormat) -> Ro
host.id().name()
);
let mut format = format;
if format != AudioFormat::S16 && format != AudioFormat::F32 {
unimplemented!("Rodio currently only supports F32 and S16 formats");
error!("Rodio currently only supports F32 and S16 formats, falling back to S16");
format = AudioFormat::S16;
}
let (sink, stream) = create_sink(&host, device, format).unwrap();