pub fn new(loader: &dyn SampleLoader, config: BankConfig) -> Result<SoundBank, SampleNotFoundError> {
        let mut samples: Vec<Arc<LoadedSample>> = Vec::new();

        for sample_config in &config.samples {
            let sample = match loader.get(sample_config) {
                None => {
                    return Err(SampleNotFoundError {});
                },
                Some(v) => v,
            };
            samples.push(sample);
        }

        Ok(SoundBank { config, samples })
    }
/// Create a new SoundBank by parsing the config and loading all audio samples into memory.
Create a new SoundBank by parsing the config and loading all audio samples into memory.
Create a new SoundBank by parsing the config and loading all audio samples into memory .
pub fn new(loader: &dyn SampleLoader, config: BankConfig) -> Result<SoundBank, SampleNotFoundError> {
        let mut samples: Vec<Arc<LoadedSample>> = Vec::new();
        for sample_config in &config.samples {
            let sample = match loader.get(sample_config) {
                None => {
                    return Err(SampleNotFoundError {});
                },
                Some(v) => v,
            };
            samples.push(sample);
        }
        Ok(SoundBank { config, samples })
    }
pub fn new ( loader : & dyn SampleLoader , config : BankConfig ) -> Result < SoundBank , SampleNotFoundError > { let mut samples : Vec < Arc < LoadedSample > > = Vec :: new ( ) ; for sample_config in & config . samples { let sample = match loader . get ( sample_config ) { None => { return Err ( SampleNotFoundError { } ) ; } , Some ( v ) => v , } ; samples . push ( sample ) ; } Ok ( SoundBank { config , samples } ) }
Create a new SoundBank by parsing the config and loading all audio samples into memory.
Create a new SoundBank by parsing the config and loading all audio samples into memory .
loader
&dyn SampleLoader
config
BankConfig
loader
&dyn SampleLoader
config
BankConfig