The SDK provides two different programming interfaces (API).
See the SYNC API Documentation for details.
This is the easiest way to use the library when writing a player that has a GUI (Graphical User Interface), because it lets the GUI run in its own thread/process, while the decoding happens independently without blocking anything.
The decoding thread/process of the ASYNC API is implemented internally using a synchronous decoder object and calls to the SYNC API, so all features of the SYNC API are available to the ASYNC API.
See the ASYNC API Documentation for details.
Whether they are accessed through the SYNC API or the ASYNC API, these components and their functionality are the same.
The Xaudio architecture is modular. This means that the input, decoding
and output are separate functional blocks that perform their individual
tasks. Also, these modules can be added or replaced at runtime.
This means that it is very easy to write a small set of routines to
use as new input or output modules very easily, and attach these modules
at runtime so that the decoding engine can use them.
At the core of the system is the decoder (XA_DecoderInfo). Before you can start decoding an input stream into output samples, an input and an output module must be specified (the output module can be omitted if the library is used to only decode to a memory buffer). The decoder object will process data by reading bytes from the input module, parse it, decode it, and pass the resulting output sample buffer to the output module. Also, input filters can be inserted between the input module and the decoder for pre-processing of data, and output filters can be inserted between the decoder and the output module to post-process the samples.
Modules can be implemented as routines linked with the main program, or separated in a DLL (dynamically linked library), and attached at runtime.Input and Output modules and filters are registered with the decoder object, and it is when instantiating a new input or a new output that the decoder object will choose which module to use, based on the parameters provided by the caller.
Each module must implement a minimum set of functions that allow to query information about the module (its name, version, etc?) and participate in the module selection process. In addition, a module implements functions to perform the input of data or the output of audio samples.
See the Xaudio Modules Documentation for detailsInput Modules
An input module object (XA_InputModule) implements several entry points that perform basic data input functions (open and close an input, read bytes, seek to a position, get input specific flags, etc?)Output Modules
An output module (XA_OutputModule) implements several entry points that perform basic output functions (open and close an output, write audio samples, set sampling frequency and channel configuration, get device specific flags, etc?)
Filters are similar to input and output modules, but instead of actually reading from an input, or writing to an output, they are inserted between the input source and the decoder, or between the decoder and the output, and are used to pre-process input data (to perform decryption of encrypted data for instance), or post-process output data (to perform sound effects or other operations).
The Xaudio SDK comes with a set of built-in input and output modules (to support the standard methods of input from a file or an HTTP, FTP or UDP network stream, and standard methods of output to a soundcard or a file in WAV or RAW format), and sample code is included that shows how to write external input/output modules.
See the Xaudio Modules Documentation for details
External modules are modules that are not implemented as built-in modules. They can be implemented by the application developer or by third parties, and be packaged as dynamic libraries (DLL), or static libraries.An example of an external input module could be to input data from a network stream with a non-standard protocol.
An example of an external output module could be to output to a proprietary file format.In the same way, the decoding engine supports external input and output filters.