class

MAudioPlayer

Object-oriented audio handle exposed to Visual Scripting. Every MFUNCTION below becomes a node in the Visual Script catalog (built from MClass function tables), so a graph can load a clip and drive its playback the same way gameplay C++ would. The wrapper owns one AudioSource, created lazily on the first Load / PlayOneShot; calls made before anything is loaded are safe no-ops, which keeps the nodes usable from a graph that runs before the audio engine is up.

Module
Audio
Header
#include "Audio/MAudioPlayer.h"
Namespace
Mowo
Reflection
Reflected by MowoHeaderTool

Constructors

SignatureNameDescription
MAudioPlayer()MAudioPlayer
~MAudioPlayer() override~MAudioPlayer

Public functions

ReturnsNameDescription
boolLoadLoad a clip (VFS path) onto this component's voice, replacing any clip it already holds.
voidPlay
voidStop
voidPause
voidSetVolume
voidSetPitch
boolIsPlaying
voidSetBusBus index into AudioBus (0 Master, 1 Music, 2 SFX, 3 Voice, 4 Ambient); out-of-range falls back to SFX.
voidPlayOneShotFire-and-forget: plays clipPath once through the engine's one-shot pool on this component's bus, independent of the held voice.

Function details

MAudioPlayer

C++
MAudioPlayer()

~MAudioPlayer

C++
~MAudioPlayer() override

Load

C++
bool Load(const std::string& clipPath)

Load a clip (VFS path) onto this component's voice, replacing any clip it already holds. Returns false when the engine is down or the path fails.

Play

C++
void Play()

Stop

C++
void Stop()

Pause

C++
void Pause()

SetVolume

C++
void SetVolume(float volume)

SetPitch

C++
void SetPitch(float pitch)

IsPlaying

C++
bool IsPlaying() const

SetBus

C++
void SetBus(int32_t bus)

Bus index into AudioBus (0 Master, 1 Music, 2 SFX, 3 Voice, 4 Ambient); out-of-range falls back to SFX. Applies to the next Load / PlayOneShot.

PlayOneShot

C++
void PlayOneShot(const std::string& clipPath)

Fire-and-forget: plays clipPath once through the engine's one-shot pool on this component's bus, independent of the held voice. Cheaper than Load+Play for footstep-style triggers that never need to be stopped.

Generated from Audio/MAudioPlayer.h via audio.json · Oct 26, 2026Version 1.0.0