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
sourcepub fn prepare(&mut self, audio_settings: AudioProcessorSettings)
pub 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.
pub fn process<BufferType: AudioBuffer<SampleType = f32>>(
&mut self,
data: &mut BufferType
)
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
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