pub struct SndFile { /* private fields */ }
Expand description
Main struct of this crate.
Implementations
sourceimpl SndFile
impl SndFile
sourcepub fn get_samplerate(&self) -> usize
pub fn get_samplerate(&self) -> usize
Get sample rate.
Return values should be greater than zero.
sourcepub fn get_channels(&self) -> usize
pub fn get_channels(&self) -> usize
Get channel count.
Return values should be greater than zero.
sourcepub fn get_major_format(&self) -> MajorFormat
pub fn get_major_format(&self) -> MajorFormat
Get audio container format
sourcepub fn get_subtype_format(&self) -> SubtypeFormat
pub fn get_subtype_format(&self) -> SubtypeFormat
Get audio encoding format
sourcepub fn get_endian(&self) -> Endian
pub fn get_endian(&self) -> Endian
Get audio file endian
Usually returns Endian::File
sourcepub fn is_seekable(&self) -> bool
pub fn is_seekable(&self) -> bool
Check if this file seekable
If not, many functions like len
or read_all_to_vec
will return an error.
sourcepub fn get_raw_struct(&self) -> &UnsafeSndFile
pub fn get_raw_struct(&self) -> &UnsafeSndFile
Useful if you want to do something unsafe.
Trait Implementations
sourceimpl SndFileIO<f32> for SndFile
impl SndFileIO<f32> for SndFile
sourcefn read_to_slice(&mut self, dst: &mut [f32]) -> Result<usize, ()>
fn read_to_slice(&mut self, dst: &mut [f32]) -> Result<usize, ()>
Read frames from current I/O cursor, returns the number of frames read if success. Read more
sourcefn write_from_slice(&mut self, src: &[f32]) -> Result<usize, ()>
fn write_from_slice(&mut self, src: &[f32]) -> Result<usize, ()>
Read frames from file, returns the number of frames written if success. Read more
sourcefn read_all_to_vec(&mut self) -> Result<Vec<f32>, ()>
fn read_all_to_vec(&mut self) -> Result<Vec<f32>, ()>
Read all frames into a Vec<_>
if success. Read more
sourcefn read_to_iter<'a, I>(&mut self, dst: I) -> Result<usize, ()> where
I: ExactSizeIterator<Item = &'a mut T>,
fn read_to_iter<'a, I>(&mut self, dst: I) -> Result<usize, ()> where
I: ExactSizeIterator<Item = &'a mut T>,
Read frames from current I/O cursor, returns the number of frames read if success. Read more
sourcefn write_from_iter<'a, I>(&mut self, src: I) -> Result<usize, ()> where
I: ExactSizeIterator<Item = T>,
fn write_from_iter<'a, I>(&mut self, src: I) -> Result<usize, ()> where
I: ExactSizeIterator<Item = T>,
Read frames from file, returns the number of frames written if success. Read more
sourceimpl SndFileIO<f64> for SndFile
impl SndFileIO<f64> for SndFile
sourcefn read_to_slice(&mut self, dst: &mut [f64]) -> Result<usize, ()>
fn read_to_slice(&mut self, dst: &mut [f64]) -> Result<usize, ()>
Read frames from current I/O cursor, returns the number of frames read if success. Read more
sourcefn write_from_slice(&mut self, src: &[f64]) -> Result<usize, ()>
fn write_from_slice(&mut self, src: &[f64]) -> Result<usize, ()>
Read frames from file, returns the number of frames written if success. Read more
sourcefn read_all_to_vec(&mut self) -> Result<Vec<f64>, ()>
fn read_all_to_vec(&mut self) -> Result<Vec<f64>, ()>
Read all frames into a Vec<_>
if success. Read more
sourcefn read_to_iter<'a, I>(&mut self, dst: I) -> Result<usize, ()> where
I: ExactSizeIterator<Item = &'a mut T>,
fn read_to_iter<'a, I>(&mut self, dst: I) -> Result<usize, ()> where
I: ExactSizeIterator<Item = &'a mut T>,
Read frames from current I/O cursor, returns the number of frames read if success. Read more
sourcefn write_from_iter<'a, I>(&mut self, src: I) -> Result<usize, ()> where
I: ExactSizeIterator<Item = T>,
fn write_from_iter<'a, I>(&mut self, src: I) -> Result<usize, ()> where
I: ExactSizeIterator<Item = T>,
Read frames from file, returns the number of frames written if success. Read more
sourceimpl SndFileIO<i16> for SndFile
impl SndFileIO<i16> for SndFile
sourcefn read_to_slice(&mut self, dst: &mut [i16]) -> Result<usize, ()>
fn read_to_slice(&mut self, dst: &mut [i16]) -> Result<usize, ()>
Read frames from current I/O cursor, returns the number of frames read if success. Read more
sourcefn write_from_slice(&mut self, src: &[i16]) -> Result<usize, ()>
fn write_from_slice(&mut self, src: &[i16]) -> Result<usize, ()>
Read frames from file, returns the number of frames written if success. Read more
sourcefn read_all_to_vec(&mut self) -> Result<Vec<i16>, ()>
fn read_all_to_vec(&mut self) -> Result<Vec<i16>, ()>
Read all frames into a Vec<_>
if success. Read more
sourcefn read_to_iter<'a, I>(&mut self, dst: I) -> Result<usize, ()> where
I: ExactSizeIterator<Item = &'a mut T>,
fn read_to_iter<'a, I>(&mut self, dst: I) -> Result<usize, ()> where
I: ExactSizeIterator<Item = &'a mut T>,
Read frames from current I/O cursor, returns the number of frames read if success. Read more
sourcefn write_from_iter<'a, I>(&mut self, src: I) -> Result<usize, ()> where
I: ExactSizeIterator<Item = T>,
fn write_from_iter<'a, I>(&mut self, src: I) -> Result<usize, ()> where
I: ExactSizeIterator<Item = T>,
Read frames from file, returns the number of frames written if success. Read more
sourceimpl SndFileIO<i32> for SndFile
impl SndFileIO<i32> for SndFile
sourcefn read_to_slice(&mut self, dst: &mut [i32]) -> Result<usize, ()>
fn read_to_slice(&mut self, dst: &mut [i32]) -> Result<usize, ()>
Read frames from current I/O cursor, returns the number of frames read if success. Read more
sourcefn write_from_slice(&mut self, src: &[i32]) -> Result<usize, ()>
fn write_from_slice(&mut self, src: &[i32]) -> Result<usize, ()>
Read frames from file, returns the number of frames written if success. Read more
sourcefn read_all_to_vec(&mut self) -> Result<Vec<i32>, ()>
fn read_all_to_vec(&mut self) -> Result<Vec<i32>, ()>
Read all frames into a Vec<_>
if success. Read more
sourcefn read_to_iter<'a, I>(&mut self, dst: I) -> Result<usize, ()> where
I: ExactSizeIterator<Item = &'a mut T>,
fn read_to_iter<'a, I>(&mut self, dst: I) -> Result<usize, ()> where
I: ExactSizeIterator<Item = &'a mut T>,
Read frames from current I/O cursor, returns the number of frames read if success. Read more
sourcefn write_from_iter<'a, I>(&mut self, src: I) -> Result<usize, ()> where
I: ExactSizeIterator<Item = T>,
fn write_from_iter<'a, I>(&mut self, src: I) -> Result<usize, ()> where
I: ExactSizeIterator<Item = T>,
Read frames from file, returns the number of frames written if success. Read more
sourceimpl SndFileNDArrayIO<f32> for SndFile
impl SndFileNDArrayIO<f32> for SndFile
fn read_to_ndarray(&mut self, dst: ArrayViewMut2<'_, f32>) -> Result<usize, ()>
fn write_from_ndarray(&mut self, src: ArrayView2<'_, f32>) -> Result<usize, ()>
fn read_all_to_ndarray(&mut self) -> Result<Array2<f32>, ()>
sourceimpl SndFileNDArrayIO<f64> for SndFile
impl SndFileNDArrayIO<f64> for SndFile
fn read_to_ndarray(&mut self, dst: ArrayViewMut2<'_, f64>) -> Result<usize, ()>
fn write_from_ndarray(&mut self, src: ArrayView2<'_, f64>) -> Result<usize, ()>
fn read_all_to_ndarray(&mut self) -> Result<Array2<f64>, ()>
sourceimpl SndFileNDArrayIO<i16> for SndFile
impl SndFileNDArrayIO<i16> for SndFile
fn read_to_ndarray(&mut self, dst: ArrayViewMut2<'_, i16>) -> Result<usize, ()>
fn write_from_ndarray(&mut self, src: ArrayView2<'_, i16>) -> Result<usize, ()>
fn read_all_to_ndarray(&mut self) -> Result<Array2<i16>, ()>
sourceimpl SndFileNDArrayIO<i32> for SndFile
impl SndFileNDArrayIO<i32> for SndFile
fn read_to_ndarray(&mut self, dst: ArrayViewMut2<'_, i32>) -> Result<usize, ()>
fn write_from_ndarray(&mut self, src: ArrayView2<'_, i32>) -> Result<usize, ()>
fn read_all_to_ndarray(&mut self) -> Result<Array2<i32>, ()>
impl Send for SndFile
Auto Trait Implementations
impl RefUnwindSafe for SndFile
impl !Sync for SndFile
impl Unpin for SndFile
impl UnwindSafe for SndFile
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more