Struct audio_processor_file::AudioFileProcessor
source · [−]pub struct AudioFileProcessor { /* private fields */ }
Expand description
An audio processor which plays a file in loop
Implementations
sourceimpl AudioFileProcessor
impl AudioFileProcessor
pub fn from_path(
handle: &Handle,
audio_settings: AudioProcessorSettings,
path: &str
) -> Result<Self, AudioFileError>
pub fn new(
gc_handle: &Handle,
audio_file_settings: InMemoryAudioFile,
audio_settings: AudioProcessorSettings
) -> Self
sourcepub fn num_samples(&self) -> usize
pub fn num_samples(&self) -> usize
Unsafe get buffer for offline rendering
pub fn handle(&self) -> &Shared<AudioFileProcessorHandle>
sourcepub fn is_playing(&self) -> bool
pub fn is_playing(&self) -> bool
Whether the file is being played back
pub fn process_single(&self) -> impl Iterator<Item = f32> + '_
Trait Implementations
sourceimpl AudioProcessor for AudioFileProcessor
impl AudioProcessor for AudioFileProcessor
sourcefn prepare(&mut self, audio_settings: AudioProcessorSettings)
fn prepare(&mut self, audio_settings: AudioProcessorSettings)
Prepares for playback
Note: Currently this will load the audio file on the audio-thread. It’d be an interesting exercise to perform this on a background thread.
type SampleType = f32
sourcefn process<BufferType: AudioBuffer<SampleType = f32>>(
&mut self,
data: &mut BufferType
)
fn process<BufferType: AudioBuffer<SampleType = f32>>(
&mut self,
data: &mut BufferType
)
Process a block of samples by mutating the input
AudioBuffer
Auto Trait Implementations
impl !RefUnwindSafe for AudioFileProcessor
impl Send for AudioFileProcessor
impl Sync for AudioFileProcessor
impl Unpin for AudioFileProcessor
impl !UnwindSafe for AudioFileProcessor
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
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