Defined in carb/audio/IAudioData.h

struct EncodeStateDesc

a descriptor for creating an encoder state object.

This can encode the data into either a stream object or a sound data object. Additional encoder settings depend on the output format that is chosen.

Public Members

EncodeStateFlags flags

flags to control the behavior of the encoder.

At least one of the kEncodeStateTarget* flags must be specified.

const SoundData *soundData

The SoundData this encoding is associated with, if any.

The Metadata and event points will be copied from this to the header of the encoded data. This can be set to nullptr if there is no SoundData associated with this encoding.

SoundData *target

The target for the encoder.

This may not be nullptr. Note that the target’s format information will be retrieved to determine the expected format for the encoder’s output. At least for the channel count and frame rate, this information must also match that of the encoder’s input stream. The sample format is the only part of the format information that the encoder may change. target is treated as if it were empty. Any existing valid length will be ignored and the encoder will begin writing at the start of the buffer. If the metadata or event points are set to be copied, from soundData, then those elements of target will be cleared first. Passing fEncodeStateFlagStripMetaData or fEncodeStateFlagStripEventPoints will also clear the metadata and event points, respectively.

SampleFormat inputFormat

the expected input format to the encoder.

This must be one of the SampleFormat::ePcm* formats.

void *encoderSettings

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

reserved for future expansion.

This must be set to nullptr.