carb::audio::SoundDataSaveDesc

Defined in carb/audio/IAudioUtils.h

struct SoundDataSaveDesc

a descriptor of how a sound data object should be written out to file.

This can optionally convert the audio data to a different format. Note that transcoding the audio data could result in a loss in quality depending on both the source and destination formats.

Public Members

SaveFlags flags = 0

Flags that alter the behavior of saving the file.

These may indicate to the file writer that certain elements in the file should be stripped, for example.

SampleFormat format = SampleFormat::eDefault

the format that the sound data object should be saved in.

Note that if the data was fully decoded on load, this may still result in some quality loss if the data needs to be re-encoded. This may be SampleFormat::eDefault to write the sound to file in the sound’s encoded format.

const SoundData *soundData

the sound data to be written out to file.

This may not be nullptr. Depending on the data’s original format and flags and the requested destination format, there may be some quality loss if the data needs to be decoded or re-encoded. This may not be a streaming sound.

const char *filename

the destination filename for the sound data.

This may be a relative or absolute path. For relative paths, these will be resolved according to the rules of the IFileSystem interface. This may not be nullptr.

void *encoderSettings = nullptr

additional output format dependent encoder settings.

This should be nullptr for PCM data formats. Additional objects will be defined for encoder formats that require additional parameters (optional or otherwise). For formats that require additional settings, this may not be nullptr. Use getCodecFormatInfo() to retrieve the info for the codec to find out if the additional settings are required or not.

void *ext = nullptr

reserved for future expansion.

This must be set to nullptr.