Class Sound
Defined in File Sound.hpp
Inheritance Relationships
Base Type
public Cacao::Asset
(Class Asset)
Class Documentation
-
class Sound : public Cacao::Asset
Asset type for audio.
Public Functions
-
virtual void Realize()
Convert the audio data into a form suitable for playback.
- Throws:
BadRealizeStateException – If the sound is already realized
BadInitStateException – If the audio system is not initialized
Public Static Functions
-
static inline std::shared_ptr<Sound> Create(std::vector<char> &&encodedAudio, const std::string &addr)
Create a new sound from encoded audio data.
- Parameters:
encodedAudio – A buffer of audio, encoded in the format of WAV, MP3, Ogg Vorbis, or Ogg Opus
addr – The resource address to associate with the sound
- Throws:
BadValueException – If the audio buffer is empty
BadValueException – If the address is malformed
-
virtual void Realize()