Struct audio_util::file_streams::FileStreamSource
source · struct FileStreamSource {
file: File,
file_size: usize,
offset: Arc<AtomicUsize>,
}
Fields§
§file: File
§file_size: usize
§offset: Arc<AtomicUsize>
Implementations§
Trait Implementations§
source§impl StreamSource for FileStreamSource
impl StreamSource for FileStreamSource
source§fn new_async_playback_stream(
&mut self,
num_channels: usize,
format: SampleFormat,
frame_rate: u32,
buffer_size: usize,
_ex: &dyn AudioStreamsExecutor
) -> Result<(Box<dyn StreamControl>, Box<dyn AsyncPlaybackBufferStream>), BoxError>
fn new_async_playback_stream( &mut self, num_channels: usize, format: SampleFormat, frame_rate: u32, buffer_size: usize, _ex: &dyn AudioStreamsExecutor ) -> Result<(Box<dyn StreamControl>, Box<dyn AsyncPlaybackBufferStream>), BoxError>
Returns a stream control and async buffer generator object. These are separate as the buffer
generator might want to be passed to the audio stream.
source§fn new_playback_stream(
&mut self,
_num_channels: usize,
_format: SampleFormat,
_frame_rate: u32,
_buffer_size: usize
) -> Result<(Box<dyn StreamControl>, Box<dyn PlaybackBufferStream>), BoxError>
fn new_playback_stream( &mut self, _num_channels: usize, _format: SampleFormat, _frame_rate: u32, _buffer_size: usize ) -> Result<(Box<dyn StreamControl>, Box<dyn PlaybackBufferStream>), BoxError>
Returns a stream control and buffer generator object. These are separate as the buffer
generator might want to be passed to the audio stream.
§fn async_new_async_playback_stream<'life0, 'life1, 'async_trait>(
&'life0 mut self,
num_channels: usize,
format: SampleFormat,
frame_rate: u32,
buffer_size: usize,
ex: &'life1 dyn AudioStreamsExecutor
) -> Pin<Box<dyn Future<Output = Result<(Box<dyn StreamControl>, Box<dyn AsyncPlaybackBufferStream>), Box<dyn Error + Send + Sync>>> + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn async_new_async_playback_stream<'life0, 'life1, 'async_trait>(
&'life0 mut self,
num_channels: usize,
format: SampleFormat,
frame_rate: u32,
buffer_size: usize,
ex: &'life1 dyn AudioStreamsExecutor
) -> Pin<Box<dyn Future<Output = Result<(Box<dyn StreamControl>, Box<dyn AsyncPlaybackBufferStream>), Box<dyn Error + Send + Sync>>> + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Returns a stream control and async buffer generator object asynchronously.
Default implementation calls and blocks on
new_async_playback_stream()
.§fn new_capture_stream(
&mut self,
num_channels: usize,
format: SampleFormat,
frame_rate: u32,
buffer_size: usize,
_effects: &[StreamEffect]
) -> Result<(Box<dyn StreamControl>, Box<dyn CaptureBufferStream>), Box<dyn Error + Send + Sync>>
fn new_capture_stream( &mut self, num_channels: usize, format: SampleFormat, frame_rate: u32, buffer_size: usize, _effects: &[StreamEffect] ) -> Result<(Box<dyn StreamControl>, Box<dyn CaptureBufferStream>), Box<dyn Error + Send + Sync>>
Returns a stream control and buffer generator object. These are separate as the buffer
generator might want to be passed to the audio stream.
Default implementation returns
NoopStreamControl
and NoopCaptureStream
.§fn new_async_capture_stream(
&mut self,
num_channels: usize,
format: SampleFormat,
frame_rate: u32,
buffer_size: usize,
_effects: &[StreamEffect],
_ex: &dyn AudioStreamsExecutor
) -> Result<(Box<dyn StreamControl>, Box<dyn AsyncCaptureBufferStream>), Box<dyn Error + Send + Sync>>
fn new_async_capture_stream( &mut self, num_channels: usize, format: SampleFormat, frame_rate: u32, buffer_size: usize, _effects: &[StreamEffect], _ex: &dyn AudioStreamsExecutor ) -> Result<(Box<dyn StreamControl>, Box<dyn AsyncCaptureBufferStream>), Box<dyn Error + Send + Sync>>
Returns a stream control and async buffer generator object. These are separate as the buffer
generator might want to be passed to the audio stream.
Default implementation returns
NoopStreamControl
and NoopCaptureStream
.§fn async_new_async_capture_stream<'life0, 'life1, 'life2, 'async_trait>(
&'life0 mut self,
num_channels: usize,
format: SampleFormat,
frame_rate: u32,
buffer_size: usize,
effects: &'life1 [StreamEffect],
ex: &'life2 dyn AudioStreamsExecutor
) -> Pin<Box<dyn Future<Output = Result<(Box<dyn StreamControl>, Box<dyn AsyncCaptureBufferStream>), Box<dyn Error + Send + Sync>>> + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn async_new_async_capture_stream<'life0, 'life1, 'life2, 'async_trait>(
&'life0 mut self,
num_channels: usize,
format: SampleFormat,
frame_rate: u32,
buffer_size: usize,
effects: &'life1 [StreamEffect],
ex: &'life2 dyn AudioStreamsExecutor
) -> Pin<Box<dyn Future<Output = Result<(Box<dyn StreamControl>, Box<dyn AsyncCaptureBufferStream>), Box<dyn Error + Send + Sync>>> + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Returns a stream control and async buffer generator object asynchronously.
Default implementation calls and blocks on
new_async_capture_stream()
.Auto Trait Implementations§
impl RefUnwindSafe for FileStreamSource
impl Send for FileStreamSource
impl Sync for FileStreamSource
impl Unpin for FileStreamSource
impl UnwindSafe for FileStreamSource
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more