Appends audio data to the codec’s input buffer.
- iOS 2.0+
- macOS 10.2+
- Mac Catalyst 13.0+
- tvOS 9.0+
An audio codec object. Because an audio codec object is a Component Manger component instance, you can use the Component Manager (for example, the functions
Findand OpenAComponent) to obtain an audio codec object.
The audio data to be sent to the codec. Indicate there is no more data to process by passing a buffer of
On input, the size in bytes of the data pointed to by the
inparameter. On output, the number of bytes the codec actually appended to its input buffer.
On input, the number of elements in the
NULLfor this parameter if the input data has a constant number of frames per packet. On return, the number of packets actually processed by the codec.
For audio data that has a variable number of frames per packet, an array of
Audiostructures that describes the packet layout. Pass
Stream Packet Description
NULLfor this parameter if the input data has a constant number of frames per packet.
No if successful. Returns
k if the codec has not been initialized. See Result Codes for other possible values.
A packet is the smallest, indivisible block of data for a given audio format. For linear PCM (pulse-code modulated) data, each packet contains exactly one frame, where a frame is a set of samples representing one sample for each channel. For compressed audio data formats, the number of frames in a packet depends on the encoding. For example, a packet of AAC represents 1024 frames of PCM. In some formats, the number of frames per packet varies. For such formats, you must include an array of
Audio structures that describes the packet layout.
Input data can be fed into an encoder and some decoders in blocks of any size (even byte by byte). However, if the encoded format of the input data fed to a decoder has a variable number of frames per packet, the data must be provided in multiples of whole packets. A codec’s properties provide information about allowable types of input and output, minimum and maximum buffer sizes, and so forth. Use the
Audio function to read a codec’s properties. The properties are described in Global Codec Properties and Instance Codec Properties.
The combination of the
Audio functions implement a "push-pull" model of data handling. First, the input data is pushed into the codec, then the resulting output data is pulled out of that same codec.