pub trait AymBackend: Sized {
type SoundSample: AySample + Debug;
// Required methods
fn new(
chip: SoundChip,
mode: AyMode,
frequency: usize,
sample_rate: usize,
) -> Self;
fn write_register(&mut self, address: u8, value: u8);
fn next_sample(&mut self) -> StereoSample<Self::SoundSample>;
}
Expand description
Sound library generation backend.
Currently is only one backend - AymPrecise,
Required Associated Types§
Sourcetype SoundSample: AySample + Debug
type SoundSample: AySample + Debug
Resulting sample type
Required Methods§
Sourcefn new(
chip: SoundChip,
mode: AyMode,
frequency: usize,
sample_rate: usize,
) -> Self
fn new( chip: SoundChip, mode: AyMode, frequency: usize, sample_rate: usize, ) -> Self
Creates new aym instance.
frequency
- frequency of the sound chip in Hz
sample_rate
- target device sound sample rate
Sourcefn write_register(&mut self, address: u8, value: u8)
fn write_register(&mut self, address: u8, value: u8)
Write value to the sound chip register. address
should be in [0..AY_REGISTER_COUNT]
Sourcefn next_sample(&mut self) -> StereoSample<Self::SoundSample>
fn next_sample(&mut self) -> StereoSample<Self::SoundSample>
Generates next sound sample
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.