pub struct AudioDataStream {
pub handle: SmartHandle<SPXAUDIOSTREAMHANDLE>,
pub properties: PropertyCollection,
}
Expand description
AudioDataStream represents audio data retrieved either from file or result of speech synthesis. Represents convenient option for manipulating and storing of syntehtized audio data Added in version 1.17.0
Fields
handle: SmartHandle<SPXAUDIOSTREAMHANDLE>
properties: PropertyCollection
Implementations
sourceimpl AudioDataStream
impl AudioDataStream
pub fn from_wav_file(filename: &str) -> Result<Self>
pub fn from_speech_synthesis_result(
speech_synthesis_result: SpeechSynthesisResult
) -> Result<Self>
pub fn get_status(&self) -> Result<StreamStatus>
pub fn can_read_data(&self, requested_size: u32) -> bool
pub fn can_read_data_at(&self, requested_size: u32, offset: u32) -> bool
sourcepub fn read(&self, buffer: &mut [u8]) -> Result<u32>
pub fn read(&self, buffer: &mut [u8]) -> Result<u32>
Read reads a chunk of the audio data stream and fill it to given buffer. It returns size of data filled to the buffer and any write error encountered.
sourcepub fn read_at(&self, buffer: &mut [u8], offset: u32) -> Result<u32>
pub fn read_at(&self, buffer: &mut [u8], offset: u32) -> Result<u32>
ReadAt reads a chunk of the audio data stream and fill it to given buffer, at specified offset. It returns size of data filled to the buffer and any write error encountered.
pub async fn save_wav_file_async(&self, filename: &str) -> Result<()>
pub fn get_offset(&self) -> Result<u32>
pub fn set_offset(&self, offset: u32) -> Result<()>
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for AudioDataStream
impl Send for AudioDataStream
impl !Sync for AudioDataStream
impl Unpin for AudioDataStream
impl UnwindSafe for AudioDataStream
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