|
utility 2026.1.9
A comprehensive C++ utilities library tailored for the development of modern desktop and extended reality (XR) applications.
|
Decoder implementation for Waveform Audio File Format (WAV) files. More...
#include <headers/utility/sound/decoder/wav_decoder.hpp>


Public Member Functions | |
| WAVDecoder () | |
| Creates a WAV decoder instance. | |
| ~WAVDecoder () override | |
| Destroys the WAV decoder instance. | |
| bool | canDecode (const std::string &filePath) const override |
| Determines whether the specified file can be decoded. | |
| bool | canDecode (AudioDecoderType type) const override |
| Determines whether the specified decoder type is supported. | |
| std::shared_ptr< AudioBuffer > | decode (std::shared_ptr< utility::File > file) override |
| Decodes a WAV file into an AudioBuffer. | |
Public Member Functions inherited from utility::sound::AAudioDecoder | |
| virtual | ~AAudioDecoder ()=default |
| Virtual destructor. | |
| ALenum | getALFormat (uint16_t channels, uint16_t bitsPerSample) const |
| Converts audio properties to an OpenAL format. | |
Decoder implementation for Waveform Audio File Format (WAV) files.
WAVDecoder uses the dr_wav library to decode WAV-encoded audio data into raw Pulse-Code Modulation (PCM) samples compatible with OpenAL.
The decoder supports uncompressed PCM WAV files and uploads the decoded samples to an AudioBuffer instance for playback.
Definition at line 41 of file wav_decoder.hpp.
| utility::sound::WAVDecoder::WAVDecoder | ( | ) |
Creates a WAV decoder instance.
Definition at line 34 of file wav_decoder.cpp.

|
override |
Destroys the WAV decoder instance.
Definition at line 39 of file wav_decoder.cpp.

|
overridevirtual |
Determines whether the specified decoder type is supported.
| type | Audio decoder type to test. |
Implements utility::sound::AAudioDecoder.
Definition at line 51 of file wav_decoder.cpp.
|
overridevirtual |
Determines whether the specified file can be decoded.
Compatibility is determined from the file extension.
| filePath | Path to the audio file. |
Implements utility::sound::AAudioDecoder.
Definition at line 44 of file wav_decoder.cpp.
|
overridevirtual |
Decodes a WAV file into an AudioBuffer.
The encoded audio stream is decoded into PCM samples and uploaded to an AudioBuffer for playback.
| file | The file containing WAV-encoded audio data. |
Implements utility::sound::AAudioDecoder.
Definition at line 57 of file wav_decoder.cpp.