mirror of
https://github.com/librespot-org/librespot.git
synced 2025-10-03 01:39:28 +02:00
feat: fallback to S16 format if unsupported in Rodio backend
This commit is contained in:
parent
ce1ab8ff3f
commit
fdd4a16fdc
1 changed files with 3 additions and 1 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue