Symphonia: symphonia-play crashes on Windows 10 if the audio file's sample rate doesn't match the output device's default sample rate
If I try to play an audio file that has a sample rate that is different than the sample rate that is set as the default format for my audio device, symphonia-play
crashes. I’m guessing that this might not strictly be a bug, per se, but just a side effect of opening the default audio device with its default configuration. If so, I think to resolve this it would have to check the sample rate of the file before opening the device, then try to open the device using a matching sample rate. Is that correct?
ERROR symphonia_play::output::cpal > audio output stream open error: The requested stream configuration is not supported by the device.
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: OpenStreamError', symphonia-play\src\main.rs:248:74
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
error: process didn't exit successfully: `target\release\symphonia-play.exe D:\test.flac` (exit code: 101)
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 16 (16 by maintainers)
I gave
symphonia-play
a try in a virtual machine and confirmed the issue. Turns out this is fully expected behaviour. WASAPI doesn’t perform resampling in shared mode so the application must match the device’s sample rate. I’ll look into usingdasp
forsymphonia-play
.