carb::audio::SoundLoadParameters

Defined in carb/audio/IAudioData.h

struct SoundLoadParameters : public carb::assets::LoadParameters

additional load parameters for sound data objects.

These are passed through to the asset loader as a way of passing additional options beyond just the filename and flags. These additional options will persist for the lifetime of the loaded asset and will be passed to the loader function each time that asset needs to be reloaded from its original data source. Any shallow copied objects in here must be guaranteed persistent by the caller for the entire period the asset is valid. It is the host app’s responsibility to clean up any resources in this object once the asset it was used for has been unloaded.

In general, it is best practice not to fill in any of the pointer members of this struct and to allow them to just use their default behavior.

Public Members

SoundDataLoadDesc params = {}

additional parameters to pass to the asset loader.

The values in here will follow all the same rules as using the SoundDataLoadDesc structure to directly load a sound data object, except that the dataBlob and dataBlobLengthInBytes values will be ignored (since they are provided by the asset loader system). The other behavior that will be ignored will be that the fDataFlagInMemory flag will always be used. Loading a sound data object through the asset system does not support loading from a disk filename (the asset system itself will handle that if the data source supports it).

Note

most of the values in this parameter block are still optional. Whether each value is needed or not often depends on the flags that are specified.

Note

most the pointer members in this parameter block should be set to nullptr for safety and ease of cleanup. This includes the name, dataBlob, and encoderSettings values. Setting the readCallbackContext and destructionCallbackContext values is acceptable because the host app is always expected to manage those objects’ lifetimes anyway.