Skip to content

Commit

Permalink
Merge branch 'master' of github.com:RustAudio/rodio
Browse files Browse the repository at this point in the history
  • Loading branch information
dvdsk committed Feb 15, 2025
2 parents 3379fe9 + 70d01da commit b57c043
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/decoder/wav.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ where
let channels = spec.channels;

let total_duration = {
let sample_rate = sample_rate as u64;
let secs = len / sample_rate;
let nanos = ((len % sample_rate) * 1_000_000_000) / sample_rate;
let data_rate = sample_rate as u64 * channels as u64;
let secs = len / data_rate;
let nanos = ((len % data_rate) * 1_000_000_000) / data_rate;
Duration::new(secs, nanos as u32)
};

Expand Down

0 comments on commit b57c043

Please sign in to comment.