Struct wavefile::WaveFile
[−]
[src]
pub struct WaveFile { /* fields omitted */ }
Methods
impl WaveFile
[src]
fn open<S: Into<String>>(path: S) -> Result<WaveFile, WaveError>
Constructs a new WaveFile
.
Example
use wavefile::{WaveFile,WaveError}; match WaveFile::open("./fixtures/test-s24le.wav") { Ok(f) => f, Err(e) => panic!("Couldn't open example file: {}", e) };
fn channels(&self) -> usize
The number of audio channels in the file.
fn sample_rate(&self) -> usize
The number of samples present for one second of audio.
fn len(&self) -> usize
The total number of frames present in the file.
Each frame will contain channels()
number of samples.
fn bits_per_sample(&self) -> usize
fn data_format(&self) -> Format
fn speakers(&self) -> Option<Vec<SpeakerPosition>>
fn info(&self) -> WaveInfo
Returns a copy of the WaveInfo
for this file,
parsed from the file header.
fn iter(&self) -> WaveFileIterator
Returns an iterator which yields each individual Frame
successively
until it reaches the end of the file.
Example
use wavefile::WaveFile; let wav = WaveFile::open("./fixtures/test-s24le.wav").unwrap(); for frame in wav.iter() { println!("{:?}", frame); }