diff --git a/src/opus.rs b/src/opus.rs index 4799068..1a2220d 100644 --- a/src/opus.rs +++ b/src/opus.rs @@ -121,6 +121,12 @@ fn write_opus_tags(w: &mut W) -> std::io::Result<()> { } fn write_ogg_(w: &mut W, pcm: &[f32], sample_rate: u32) -> Result<()> { + match sample_rate { + 8000 | 12000 | 16000 | 24000 | 48000 => {} + sample_rate => { + anyhow::bail!("unsupported sample rate for opus {sample_rate}, try resample_to=48000") + } + } let mut pw = ogg::PacketWriter::new(w); // Write the opus headers and tags