11#if defined(__has_include) && __has_include(<optional>)
15#include <experimental/optional>
70 std::shared_ptr<Sound> sound_;
71 std::vector<
float> buffer_;
An audio channel, different channels could be for example: "Music", "Speech" and "Sound Effects".
Sound loaded from an OGG file.
void play()
Play the sound once. If called twice the sound would also play twice.
SoundFile(const std::string &filename, std::launch policy=std::launch::async)
Load an OGG file called filename.
void load()
Block until the sound file has been fully decompressed and loaded.
bool isPlaying()
Whether the sound is still playing at least once.
void stop()
Stop the last started sound.
void setVolume(float v)
Set volume in [0, ∞]. Default is 1.0f.
void loop()
Play the sound in a loop. Can also be stopped using stop()