SoundCue
- Module
- Audio
- Header
#include "Audio/SoundCue.h"- Namespace
Mowo
Type aliases
| Alias | Description |
|---|---|
using FAssetResolverFn = bool (*)(const std::string& path, SoundCue& cue) | Resolver the asset layer (Game) installs so a cue-asset path reference can be turned into a configured cue without the Audio module depending on the asset system. Returns true and configures cue on success. |
using FCaptionSinkFn = void (*)(const std::string& key, const std::string& text, float seconds, bool speech) | Sink the subtitle system installs so a captioned cue announces itself on Play without Audio knowing anything about subtitles. Same seam as the asset resolver above. |
Constructors
| Signature | Name | Description |
|---|---|---|
SoundCue() = default | SoundCue | |
~SoundCue() = default | ~SoundCue | |
SoundCue(const SoundCue&) = delete | SoundCue | |
SoundCue(SoundCue&&) = default | SoundCue |
Public functions
| Returns | Name | Description |
|---|---|---|
SoundCue& | operator= | |
SoundCue& | operator= | |
void | AddClip | |
void | AddVoice | Append a layered voice that plays alongside the primary clip pool. |
void | ClearClips | |
int32_t | GetVoiceCount | Total simultaneous voices: the primary pool (when non-empty) plus every layered voice. |
void | SetAssetResolver | Install / invoke the cue-asset resolver (see FAssetResolverFn). |
bool | ResolveAssetToCue | |
void | SetCaptionSink | Out-of-line: sm_captionSink lives in the Audio DLL and every module compiles MOWO_API as dllexport, so an inline reader would not resolve. |
FCaptionSinkFn | GetCaptionSink | |
void | SetCaption | |
bool | HasCaption | |
const std::string& | GetCaptionKey | |
const std::string& | GetCaptionText | |
float | GetCaptionSeconds | |
bool | IsCaptionSpeech | |
AudioSource* | Play | Play a randomly selected clip on the cue's own bus. |
AudioSource* | Play | |
AudioSource* | PlayAtPosition | Play at a 3D position. |
AudioSource* | PlayAtPosition | |
void | StopAll | |
void | Tick | Release instances that have finished. |
void | SetVolumeRange | Randomization ranges |
void | SetPitchRange | |
void | SetCooldown | Cooldown to prevent rapid-fire |
void | SetAvoidRepeat | Avoid repeating the same clip consecutively |
void | SetMaxInstances | Max simultaneous instances (0 = unlimited) |
void | SetConcurrencyGroup | The FSoundClasses concurrency group every voice this cue starts joins (empty = none) and their priority for StopLowestPriority. |
const std::string& | GetConcurrencyGroup | |
void | SetPriority | |
float | GetPriority | |
void | SetBus | |
void | SetLooping | |
void | SetSpatial | |
void | SetDistanceRange | |
int32_t | GetClipCount | |
const Entry& | GetClip | |
float | GetVolumeMin | |
float | GetVolumeMax | |
float | GetPitchMin | |
float | GetPitchMax | |
float | GetCooldown | |
bool | GetAvoidRepeat | |
int32_t | GetMaxInstances | |
AudioBus | GetBus | |
bool | IsLooping | |
bool | IsSpatial | |
float | GetMinDistance | |
float | GetMaxDistance | |
int32_t | GetActiveInstanceCount |
Function details
SoundCue
SoundCue() = default~SoundCue
~SoundCue() = defaultSoundCue
SoundCue(const SoundCue&) = deleteSoundCue
SoundCue(SoundCue&&) = defaultoperator=
SoundCue& operator=(const SoundCue&) = deleteoperator=
SoundCue& operator=(SoundCue&&) = defaultAddClip
void AddClip(const std::string& clipPath, float weight = 1.0f)AddVoice
void AddVoice(const LayeredVoice& voice)Append a layered voice that plays alongside the primary clip pool. The Mixer node authors these; a single-branch cue never adds any and behaves exactly as before.
ClearClips
void ClearClips()GetVoiceCount
int32_t GetVoiceCount() constTotal simultaneous voices: the primary pool (when non-empty) plus every layered voice.
SetAssetResolver
static void SetAssetResolver(FAssetResolverFn resolver)Install / invoke the cue-asset resolver (see FAssetResolverFn).
ResolveAssetToCue
static bool ResolveAssetToCue(const std::string& path, SoundCue& cue)SetCaptionSink
static void SetCaptionSink(FCaptionSinkFn sink)Out-of-line: sm_captionSink lives in the Audio DLL and every module compiles MOWO_API as dllexport, so an inline reader would not resolve.
GetCaptionSink
static FCaptionSinkFn GetCaptionSink()SetCaption
void SetCaption(const std::string& key, const std::string& text, float seconds, bool speech)HasCaption
bool HasCaption() constGetCaptionKey
const std::string& GetCaptionKey() constGetCaptionText
const std::string& GetCaptionText() constGetCaptionSeconds
float GetCaptionSeconds() constIsCaptionSpeech
bool IsCaptionSpeech() constPlay
AudioSource* Play()Play a randomly selected clip on the cue's own bus. Returns the AudioSource playing, or nullptr on failure.
Play
AudioSource* Play(AudioBus bus)PlayAtPosition
AudioSource* PlayAtPosition(float x, float y, float z)Play at a 3D position. Forces spatialization for this instance even when the cue is authored non-spatial.
PlayAtPosition
AudioSource* PlayAtPosition(float x, float y, float z, AudioBus bus)StopAll
void StopAll()Tick
void Tick()Release instances that have finished. Play() does this on its own; a long-lived cue that is not being retriggered needs the tick so its finished voices do not sit on the mixer.
SetVolumeRange
void SetVolumeRange(float min, float max)Randomization ranges
SetPitchRange
void SetPitchRange(float min, float max)SetCooldown
void SetCooldown(float seconds)Cooldown to prevent rapid-fire
SetAvoidRepeat
void SetAvoidRepeat(bool avoid)Avoid repeating the same clip consecutively
SetMaxInstances
void SetMaxInstances(int32_t max)Max simultaneous instances (0 = unlimited)
SetConcurrencyGroup
void SetConcurrencyGroup(const std::string& group)The FSoundClasses concurrency group every voice this cue starts joins (empty = none) and their priority for StopLowestPriority. Cue voices used to start with neither, so a group shared with AudioSourceComponents never saw them.
GetConcurrencyGroup
const std::string& GetConcurrencyGroup() constSetPriority
void SetPriority(float priority)GetPriority
float GetPriority() constSetBus
void SetBus(AudioBus bus)SetLooping
void SetLooping(bool loop)SetSpatial
void SetSpatial(bool spatial)SetDistanceRange
void SetDistanceRange(float minDistance, float maxDistance)GetClipCount
int32_t GetClipCount() constGetClip
const Entry& GetClip(int32_t index) constGetVolumeMin
float GetVolumeMin() constGetVolumeMax
float GetVolumeMax() constGetPitchMin
float GetPitchMin() constGetPitchMax
float GetPitchMax() constGetCooldown
float GetCooldown() constGetAvoidRepeat
bool GetAvoidRepeat() constGetMaxInstances
int32_t GetMaxInstances() constGetBus
AudioBus GetBus() constIsLooping
bool IsLooping() constIsSpatial
bool IsSpatial() constGetMinDistance
float GetMinDistance() constGetMaxDistance
float GetMaxDistance() constGetActiveInstanceCount
int32_t GetActiveInstanceCount() const