Audio codecs are encoders and decoders provided by Apple or third-party developers for the purpose of compressing and decompressing audio streams into and from encoded formats. While codec use is encouraged, normal use should be performed through the “Audio Converter.”
Before developing an audio codec for Mac OS X, install the Core Audio SDK, available from http://developer.apple.com/audio/.
Of particular interest are the contents of /AudioCodecs/ACPublic/,
in the installed SDK.
The ACCodec Class
The ACBaseCodec Class
The ACSimpleCodec Class
Miscellaneous Headers
ACCodec is an abstract
class that defines the basic methods that an audio codec must implement.
At the very least, all codecs must subclass ACCodec to
provide basic services for those who wish to use the codec, based
on standard methods of communication expected of them. However,
two subclasses of ACCodec are
provided, which implement many of this class’s abstract methods
for your convenience.
ACBaseCodec is
a subclass of ACCodec and
provides many of the services needed by most codecs to interact
with codec clients. Property management is fully implemented in ACBaseCodec but
you may override it as needed. Also, this class provides format management
for input and outputs, including getting and setting the number
of input and output formats, and getting and setting the AudioStreamBasicDescription format
information for inputs and outputs.
ACBaseCodec does
not implement a buffer for the codec, however, and you must implement all
methods pertaining to buffer usage, depending on your chosen buffer
size and implementation.
When developing an audio codec, you must subclass ACBaseCodec.
ACSimpleCodec,
a subclass of ACBaseCodec,
provides a ring buffer implementation with a variable buffer size
providing for reallocation of the buffer. This class is provided
as a convenience for you in cases where you don’t need a custom
buffering scheme. When developing a codec, you don’t need to subclass ACSimpleCodec,
so long as you provide a buffering scheme.
Inside /AudioCodecs/ACPublic/ are other
headers that need not be modified but are necessary for the operation
of a codec, and therefore are included in order for the codec to
operate properly:
ACConditionalMacros.h.
This header helps determine which system headers need to be included
at compile time.
ACCodecDispatch.h.
An implementation of an audio codec component dispatch method.
ACCodecDispatchTypes.h.
Glue that helps ACCodecDispatch work
properly on various platforms.
Last updated: 2004-03-25