Skip to content

Commit fdd4a16

Browse files
committed
feat: fallback to S16 format if unsupported in Rodio backend
1 parent ce1ab8f commit fdd4a16

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

playback/src/audio_backend/rodio.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,10 @@ pub fn open(host: cpal::Host, device: Option<String>, format: AudioFormat) -> Ro
209209
host.id().name()
210210
);
211211

212+
let mut format = format;
212213
if format != AudioFormat::S16 && format != AudioFormat::F32 {
213-
unimplemented!("Rodio currently only supports F32 and S16 formats");
214+
error!("Rodio currently only supports F32 and S16 formats, falling back to S16");
215+
format = AudioFormat::S16;
214216
}
215217

216218
let (sink, stream) = create_sink(&host, device, format).unwrap();

0 commit comments

Comments
 (0)