Monad Engine da02fba2
> Undercity Codex_
Loading...
Searching...
No Matches
Audio.h File Reference

Reference-counted audio clip with 3D positioning. More...

#include <memory>
#include <string>
#include <vector>
#include "Common.h"
+ Include dependency graph for Audio.h:

Go to the source code of this file.

Classes

class  mnd::Audio
 Single playable audio clip backed by a decoded miniaudio stream. More...
 

Namespaces

namespace  mnd
 

Detailed Description

Reference-counted audio clip with 3D positioning.

A single mnd::Audio instance wraps one decoded miniaudio stream. Clips are loaded through the static factory and shared between callers via std::shared_ptr<Audio>. Hand them to a mnd::AudioComponent to trigger playback through the engine's mnd::AudioManager.

auto shot = mnd::Audio::Load("sfx/laser.wav");
shot->SetVolume(0.6F);
shot->Play();
static std::shared_ptr< Audio > Load(const std::string &path)
Decode an audio file from disk and return a shared instance.
Definition Audio.cpp:74

Definition in file Audio.h.