2011-07-14, 12:19
@T800 - The old code just talked directly to the audio API of the operating system, the players had to perform any conversions required to get the audio out, which meant lots of code duplication, 16bit audio, and many output inconsistencies, and no multiple stream output (eg, guisound + dvdplayer).
The Engine is an abstraction-layer which performs all the required conversions, stream mixing, resampling, etc, required to get high quality consistent output.
All the codecs now pass their raw decoded data to the streams which AE processes before passing it into the sound API and visualisation output too.
It gets even more complicated when it comes to bitstreaming as AE can operate in three modes, analog, transcode or raw passthrough.
* Analog is just that, analog.
* Transcode is when AE transparently encodes multichannel analog audio into AC3 5.1 and passes it out the sound device after encapsulating it for AC3 SPDIF.
* Raw Passthrough is where AE just passes the digital stream straight out the sound device after encapsulating it according to the format.
For example, the stream could be any one of the following
Analog:
44110hz 5.1 stream -> AE -> 44110hz 5.1 analog output (1 to 1)
44110hz 5.1 stream -> AE -> 48000hz 5.1 analog output (resampled)
44110hz 5.1 stream -> AE -> 44100hz 4.0 analog output (downmixed)
44110hz 5.1 stream -> AE -> 48100hz 4.0 analog output (resampled & downmixed)
Passthrough:
44110hz DTS-HD -> AE -> DTS -> Packetizer -> SPDIF
44110hz DTS-HD -> AE -> DTS-HD -> Packetizer -> HDMI
44110hz DTS -> AE -> DTS -> Packetizer -> HDMI
(repeat for each passthrough format, AC3, TrueHD, AAC)
Transcode:
44110hz 5.1 stream -> AE -> 44110hz 5.1 analog -> AC3Encode -> Packetizer
44110hz 5.1 stream -> AE -> 48000hz 5.1 analog -> AC3Encode -> Packetizer
44110hz 5.1 stream -> AE -> 44100hz 4.0 analog -> AC3Encode -> Packetizer
44110hz 5.1 stream -> AE -> 48100hz 4.0 analog -> AC3Encode -> Packetizer
Note that this does not take into account resolution conversion, channel remapping, or stream mixing.
In total there would have to be at least over a hundred possible input/output combinations depending on hardware, input source, user preferences, channel counts, channel mapping, sample rates.
None of this is guess work, just lots and lots of headaches.
AE's goal is to hide all this from the developer and provide a simple API that works on every platform for any random crap it is handed in the fastest and best possible way, leaving the developer to concentrate on the program rather then the issues of audio format wrangling.
The Engine is an abstraction-layer which performs all the required conversions, stream mixing, resampling, etc, required to get high quality consistent output.
All the codecs now pass their raw decoded data to the streams which AE processes before passing it into the sound API and visualisation output too.
It gets even more complicated when it comes to bitstreaming as AE can operate in three modes, analog, transcode or raw passthrough.
* Analog is just that, analog.
* Transcode is when AE transparently encodes multichannel analog audio into AC3 5.1 and passes it out the sound device after encapsulating it for AC3 SPDIF.
* Raw Passthrough is where AE just passes the digital stream straight out the sound device after encapsulating it according to the format.
For example, the stream could be any one of the following
Analog:
44110hz 5.1 stream -> AE -> 44110hz 5.1 analog output (1 to 1)
44110hz 5.1 stream -> AE -> 48000hz 5.1 analog output (resampled)
44110hz 5.1 stream -> AE -> 44100hz 4.0 analog output (downmixed)
44110hz 5.1 stream -> AE -> 48100hz 4.0 analog output (resampled & downmixed)
Passthrough:
44110hz DTS-HD -> AE -> DTS -> Packetizer -> SPDIF
44110hz DTS-HD -> AE -> DTS-HD -> Packetizer -> HDMI
44110hz DTS -> AE -> DTS -> Packetizer -> HDMI
(repeat for each passthrough format, AC3, TrueHD, AAC)
Transcode:
44110hz 5.1 stream -> AE -> 44110hz 5.1 analog -> AC3Encode -> Packetizer
44110hz 5.1 stream -> AE -> 48000hz 5.1 analog -> AC3Encode -> Packetizer
44110hz 5.1 stream -> AE -> 44100hz 4.0 analog -> AC3Encode -> Packetizer
44110hz 5.1 stream -> AE -> 48100hz 4.0 analog -> AC3Encode -> Packetizer
Note that this does not take into account resolution conversion, channel remapping, or stream mixing.
In total there would have to be at least over a hundred possible input/output combinations depending on hardware, input source, user preferences, channel counts, channel mapping, sample rates.
None of this is guess work, just lots and lots of headaches.
AE's goal is to hide all this from the developer and provide a simple API that works on every platform for any random crap it is handed in the fastest and best possible way, leaving the developer to concentrate on the program rather then the issues of audio format wrangling.