Struct audio_processor_file::AudioFileProcessor
source · pub struct AudioFileProcessor { /* private fields */ }
Expand description
An audio processor which plays a file in loop
Implementations§
source§impl 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§
source§impl AudioProcessor for AudioFileProcessor
impl AudioProcessor for AudioFileProcessor
source§fn prepare(&mut self, context: &mut AudioContext)
fn prepare(&mut self, context: &mut AudioContext)
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
source§fn process(
&mut self,
_context: &mut AudioContext,
data: &mut AudioBuffer<Self::SampleType>
)
fn process( &mut self, _context: &mut AudioContext, data: &mut AudioBuffer<Self::SampleType> )
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§
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