Skip to content

Commit

Permalink
fix(effects): off by 1 error in backwards playback
Browse files Browse the repository at this point in the history
  • Loading branch information
nenikitov committed Oct 10, 2024
1 parent 493ff22 commit 1554f4a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion engine/src/asset/sound/dat/mixer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,9 @@ impl<'a> Player<'a> {
if let Some(sample) = &channel.sample
&& direction == PlaybackDirection::Backwards
{
channel.pos_sample = sample.buffer.len_seconds();
channel.pos_sample = sample
.buffer
.index_to_seconds(sample.buffer.len_samples().saturating_sub(1));
}
}
E::SampleOffset(Some(offset)) => {
Expand Down

0 comments on commit 1554f4a

Please sign in to comment.