Implementation of complex formats

This commit is contained in:
Jamie Hardt
2020-11-23 22:38:10 -08:00
parent 358aa06f7c
commit 34e473dc49
10 changed files with 275 additions and 62 deletions

View File

@@ -4,7 +4,7 @@ use std::io::SeekFrom::{Start,};
use byteorder::LittleEndian;
use byteorder::ReadBytesExt;
use super::fmt::WaveFmt;
use super::fmt::{WaveFmt};
use super::errors::Error;
/// Read audio frames
@@ -33,7 +33,10 @@ impl<R: Read + Seek> AudioFrameReader<R> {
"Unable to read audio frames from packed formats: block alignment is {}, should be {}",
format.block_alignment, (format.bits_per_sample / 8 ) * format.channel_count);
assert!(format.tag == 1, "Unsupported format tag {}", format.tag);
assert!(format.tag == 0x01 ,
"Unsupported format tag {:?}", format.tag);
AudioFrameReader { inner , format }
}
@@ -83,5 +86,4 @@ impl<R: Read + Seek> AudioFrameReader<R> {
Ok( 1 )
}
}
}