From 3bafe32388b4eb7a48c6701e6c65044dc8c555e6 Mon Sep 17 00:00:00 2001 From: dvdsk Date: Wed, 3 Apr 2024 14:04:37 +0200 Subject: [PATCH] refactor(seek) explain why seek to sample works --- src/decoder/vorbis.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/decoder/vorbis.rs b/src/decoder/vorbis.rs index 82a4d195..827c255c 100644 --- a/src/decoder/vorbis.rs +++ b/src/decoder/vorbis.rs @@ -78,6 +78,7 @@ where #[inline] fn try_seek(&mut self, pos: Duration) -> Result<(), SeekError> { + // note sample rate in vorbis encoding is constant let samples = pos.as_secs_f32() * self.sample_rate() as f32; self.stream_reader.seek_absgp_pg(samples as u64)?;