Struct rfmod::CreateSoundexInfo [] [src]

pub struct CreateSoundexInfo {
    pub length: u32,
    pub file_offset: u32,
    pub num_channels: i32,
    pub default_frequency: i32,
    pub format: SoundFormat,
    pub decode_buffer_size: u32,
    pub initial_subsound: i32,
    pub num_subsounds: i32,
    pub inclusion_list: Vec<i32>,
    pub pcm_read_callback: SoundPcmReadCallback,
    pub pcm_set_pos_callback: SoundPcmSetPosCallback,
    pub non_block_callback: SoundNonBlockCallback,
    pub dls_name: String,
    pub encryption_key: String,
    pub max_polyphony: i32,
    pub suggested_sound_type: SoundType,
    pub speaker_map: SpeakerMapType,
    pub initial_sound_group: SoundGroup,
    pub initial_seek_position: u32,
    pub initial_seek_pos_type: TimeUnit,
    pub ignore_set_file_system: bool,
    pub cdda_force_aspi: i32,
    pub audio_queue_policy: u32,
    pub min_midi_granularity: u32,
    pub non_block_thread_id: i32,
    // some fields omitted
}

Use this structure with Sys::create_sound when more control is needed over loading. The possible reasons to use this with Sys::create_sound are:

  • Loading a file from memory.
  • Loading a file from within another larger (possibly wad/pak) file, by giving the loader an offset and length.
  • To create a user created / non file based sound.
  • To specify a starting subsound to seek to within a multi-sample sounds (ie FSB/DLS/SF2) when created as a stream.
  • To specify which subsounds to load for multi-sample sounds (ie FSB/DLS/SF2) so that memory is saved and only a subset is actually loaded/read from disk.
  • To specify 'piggyback' read and seek callbacks for capture of sound data as fmod reads and decodes it. Useful for ripping decoded PCM data from sounds as they are loaded / played.
  • To specify a MIDI DLS/SF2 sample set file to load when opening a MIDI file.

See below on what members to fill for each of the above types of sound you want to create.

Fields

[w] Optional. Specify 0 to ignore. Size in bytes of file to load, or sound to create (in this case only if FMOD_OPENUSER is used). Required if loading from memory. If 0 is specified, then it will use the size of the file (unless loading from memory then an error will be returned).

[w] Optional. Specify 0 to ignore. Offset from start of the file to start loading from. This is useful for loading files from inside big data files.

[w] Optional. Specify 0 to ignore. Number of channels in a sound mandatory if FMOD_OPENUSER or FMOD_OPENRAW is used.

[w] Optional. Specify 0 to ignore. Default frequency of sound in a sound mandatory if FMOD_OPENUSER or FMOD_OPENRAW is used. Other formats use the frequency determined by the file format.

[w] Optional. Specify 0 or ::SoundFormatNone to ignore. Format of the sound mandatory if FMOD_OPENUSER or FMOD_OPENRAW is used. Other formats use the format determined by the file format.

[w] Optional. Specify 0 to ignore. For streams. This determines the size of the double buffer (in PCM samples) that a stream uses. Use this for user created streams if you want to determine the size of the callback buffer passed to you. Specify 0 to use FMOD's default size which is currently equivalent to 400ms of the sound format created/loaded.

[w] Optional. Specify 0 to ignore. In a multi-sample file format such as .FSB/.DLS/.SF2, specify the initial subsound to seek to, only if FMOD_CREATESTREAM is used.

[w] Optional. Specify 0 to ignore or have no subsounds. In a sound created with FMOD_OPENUSER, specify the number of subsounds that are accessable with Sound::get_sub_sound. If not created with FMOD_OPENUSER, this will limit the number of subsounds loaded within a multi-subsound file. If using FSB, then if FMOD_CREATESOUNDEXINFO::inclusionlist is used, this will shuffle subsounds down so that there are not any gaps. It will mean that the indices of the sounds will be different.

[w] Optional. Specify 0 to ignore. In a multi-sample format such as .FSB/.DLS/.SF2 it may be desirable to specify only a subset of sounds to be loaded out of the whole file. This is an array of subsound indices to load into memory when created.

[w] Optional. Specify 0 to ignore. Callback to 'piggyback' on FMOD's read functions and accept or even write PCM data while FMOD is opening the sound. Used for user sounds created with FMOD_OPENUSER or for capturing decoded data as FMOD reads it.

[w] Optional. Specify 0 to ignore. Callback for when the user calls a seeking function such as Channel::set_time or Channel::set_position within a multi-sample sound, and for when it is opened.

[w] Optional. Specify 0 to ignore. Callback for successful completion, or error while loading a sound that used the FMOD_NONBLOCKING flag. Also called duing seeking, when setPosition is called or a stream is restarted.

[w] Optional. Specify 0 to ignore. Filename for a DLS or SF2 sample set when loading a MIDI file. If not specified, on Windows it will attempt to open /windows/system32/drivers/gm.dls or /windows/system32/drivers/etc/gm.dls, on Mac it will attempt to load /System/Library/Components/CoreAudio.component/Contents/Resources/gs_instruments.dls, otherwise the MIDI will fail to open. Current DLS support is for level 1 of the specification.

[w] Optional. Specify 0 to ignore. Key for encrypted FSB file. Without this key an encrypted FSB file will not load.

[w] Optional. Specify 0 to ignore. For sequenced formats with dynamic channel allocation such as .MID and .IT, this specifies the maximum voice count allowed while playing. .IT defaults to 64. .MID defaults to 32.

[w] Optional. Specify 0 or SoundTypeUnknown to ignore. Instead of scanning all codec types, use this to speed up loading by making it jump straight to this codec.

[w] Optional. Specify 0 to ignore. Use this to differ the way fmod maps multichannel sounds to speakers. See SpeakerMapType for more.

[w] Optional. Specify 0 to ignore. Specify a sound group if required, to put sound in as it is created.

[w] Optional. Specify 0 to ignore. For streams. Specify an initial position to seek the stream to.

[w] Optional. Specify 0 to ignore. For streams. Specify the time unit for the position set in initialseekposition.

[w] Optional. Specify true to ignore. Set to false to use fmod's built in file system. Ignores setFileSystem callbacks and also FMOD_CREATESOUNEXINFO file callbacks. Useful for specific cases where you don't want to use your own file system but want to use fmod's file system (ie net streaming).

[w] Optional. Specify 0 to ignore. For CDDA sounds only - if non-zero use ASPI instead of NTSCSI to access the specified CD/DVD device.

[w] Optional. Specify 0 or FMOD_AUDIOQUEUE_CODECPOLICY_DEFAULT to ignore. Policy used to determine whether hardware or software is used for decoding, see FMOD_AUDIOQUEUE_CODECPOLICY for options (iOS >= 3.0 required, otherwise only hardware is available)

[w] Optional. Specify 0 to ignore. Allows you to set a minimum desired MIDI mixer granularity. Values smaller than 512 give greater than default accuracy at the cost of more CPU and vice versa. Specify 0 for default (512 samples).

[w] Optional. Specify 0 to ignore. Specifies a thread index to execute non blocking load on. Allows for up to 5 threads to be used for loading at once. This is to avoid one load blocking another. Maximum value = 4.

Trait Implementations

impl Default for CreateSoundexInfo
[src]

[src]

Returns the "default value" for a type. Read more

Auto Trait Implementations