|
utility 2026.1.9
A comprehensive C++ utilities library tailored for the development of modern desktop and extended reality (XR) applications.
|
Factory responsible for resolving audio decoders. More...
#include <headers/utility/sound/decoder/decoder_registry.hpp>
Static Public Member Functions | |
| static std::shared_ptr< AAudioDecoder > | getDecoderForFile (const std::string &filePath, AudioDecoderType type=AudioDecoderType::UNKNOWN) |
| Retrieves a decoder compatible with the specified audio source. | |
Factory responsible for resolving audio decoders.
DecoderRegistry provides a centralized mechanism for locating an appropriate AAudioDecoder implementation for a given audio file or decoder type.
The registry abstracts format-specific decoder selection from the rest of the audio subsystem, allowing clients to decode audio files without needing to know which concrete decoder implementation is required.
Supported decoder implementations are evaluated sequentially until a compatible decoder is found.
Definition at line 53 of file decoder_registry.hpp.
|
static |
Retrieves a decoder compatible with the specified audio source.
The registry attempts to find a decoder that supports either the provided file path or the specified decoder type.
| filePath | Path to the audio file. |
| type | Explicit audio type hint. |
This is a simple implementation that checks each decoder in the registry to see if it can decode the given file path or type. In a more complex implementation, you might want to use a more efficient lookup mechanism, such as a map of file extensions to decoders, or a plugin system for dynamically loading decoders.
Definition at line 33 of file decoder_registry.cpp.
