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()
Synchronously 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
-
virtual std::shared_future<void> RealizeAsync()
Asynchronously 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
- Returns:
A future that will resolve when realization is complete or fails
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 identifier to associate with the sound
-
virtual void Realize()