fix flac bit depth

This commit is contained in:
sagudev 2022-01-22 21:28:09 +01:00
parent 29378f53a5
commit 9deb7f27f0
2 changed files with 2 additions and 1 deletions

View file

@ -36,6 +36,7 @@ fn main() {
properties.overall_bitrate().unwrap_or(0)
);
println!("Sample Rate: {}", properties.sample_rate().unwrap_or(0));
println!("Bit depth: {}", properties.bit_depth().unwrap_or(0));
println!("Channels: {}", properties.channels().unwrap_or(0));
println!("Duration: {}", duration_display);
}

View file

@ -32,7 +32,7 @@ where
let info = stream_info.read_u32::<BigEndian>()?;
let sample_rate = info >> 12;
let bits_per_sample = ((info >> 4) & 0b1111) + 1;
let bits_per_sample = ((info >> 4) & 0b11111) + 1;
let channels = ((info >> 9) & 7) + 1;
// Read the remaining 32 bits of the total samples