carb::audio::convertSoundFormat

Defined in carb/audio/AudioUtils.h

inline SoundData *carb::audio::convertSoundFormat(const IAudioUtils *iface, SoundData *snd, SampleFormat newFmt)

Convert a sound to a new sample format.

Note

When converting to any format with specific encoder settings, these will be left at their defaults.

Parameters
  • iface[in] The IAudioData interface to use.

  • snd[in] The sound to convert to a new format. This may not be nullptr.

  • newFmt[in] The new format to set the sound to. This can be any valid format; setting this to a PCM format will cause the output to be a blob of PCM data.

Returns

The new sound data created. snd and the returned value must both be released after this call once the caller is finished with them.

Returns

nullptr if the operation failed or the specified format was invalid.