[−][src]Trait spectrusty_core::audio::AudioFrame
A common trait for controllers rendering square-wave audio pulses.
This trait defines common methods to interface Blep implementations.
Required methods
pub fn ensure_audio_frame_time(
&self,
blep: &mut B,
sample_rate: u32,
cpu_hz: f64
)
[src]
&self,
blep: &mut B,
sample_rate: u32,
cpu_hz: f64
)
Sets up the Blep time rate and ensures there is enough room for the single frame's audio data.
sample_rate
is the number of samples per second of the rendered audio,cpu_hz
is the number of the emulated CPU cycles (T-states) per second.
pub fn get_audio_frame_end_time(&self) -> FTs
[src]
Returns a timestamp to be passed to Blep to end the frame.
Panics
Panics if the current frame execution didn't get to the near of end-of-frame. To check if you can actually call this method, invoke FrameState::is_frame_over.
Provided methods
pub fn end_audio_frame(&self, blep: &mut B) -> usize
[src]
Calls Blep::end_frame to finalize the frame and prepare it for rendition.
Returns a number of samples ready to be rendered in a single channel.
Panics
Panics if the current frame execution didn't get to the near of end-of-frame. To check if you can actually call this method, invoke FrameState::is_frame_over.