pub struct SF2Synthesizer { /* private fields */ }
Expand description
A SoundFont Composition
synthesizer (.sf2
specifically). Outputs as WAV format.
Made possible by rustysynth
and hound
– special thanks to their authors/contributors.
Implementations§
Source§impl SF2Synthesizer
impl SF2Synthesizer
Sourcepub fn new<P>(sf2_file: P) -> Result<SF2Synthesizer, SynthesisError>
pub fn new<P>(sf2_file: P) -> Result<SF2Synthesizer, SynthesisError>
Creates a new SoundFont Synthesizer from a SoundFont (.sf2) file with default options (sample_rate = 44.1kHz, bit-depth = 16).
Sourcepub fn new_with_options<P>(
sf2_file: P,
options: SoundFontSynthesizerOptions,
) -> Result<SF2Synthesizer, SynthesisError>
pub fn new_with_options<P>( sf2_file: P, options: SoundFontSynthesizerOptions, ) -> Result<SF2Synthesizer, SynthesisError>
Create a new SoundFont Synthesizer with custom options.
Sourcepub fn synthesize<'a, S>(&'a self, content: &'a S) -> SF2SynthesisRequest<'a, S>where
S: MidiBytesProvider,
pub fn synthesize<'a, S>(&'a self, content: &'a S) -> SF2SynthesisRequest<'a, S>where
S: MidiBytesProvider,
Prepares a synthesis request for the given content. Use further chained calls to initiate
synthesis – such as to_file
, write
or to_raw_stereo_waveforms
.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SF2Synthesizer
impl RefUnwindSafe for SF2Synthesizer
impl Send for SF2Synthesizer
impl Sync for SF2Synthesizer
impl Unpin for SF2Synthesizer
impl UnwindSafe for SF2Synthesizer
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