8#include <unordered_map>
25 bool registerClip(
const std::string& lineId,
const std::string& locale,
float duration,
26 const std::string& envelope);
28 bool bindSource(
const std::string& lineId,
const std::string& locale,
audio::Source*
source);
30 bool hasClip(
const std::string& lineId,
const std::string& locale)
const;
35 bool play(
const std::string& lineId,
const std::string& locale);
39 void update(
float dt);
41 bool isPlaying()
const;
43 float getTime()
const;
45 float getDuration()
const;
47 float getAmplitude()
const;
49 bool shouldAutoAdvance()
const;
53 void setEnvelopeRate(
float samplesPerSecond);
62 std::vector<float> envelope;
66 static std::string
key(
const std::string& lineId,
const std::string& locale);
67 Clip* resolve(
const std::string& lineId,
const std::string& locale);
68 const Clip* resolve(
const std::string& lineId,
const std::string& locale)
const;
70 std::unordered_map<std::string, Clip> clips_;
71 Clip* current_ =
nullptr;
72 std::string currentLineId_;
74 float envelopeRate_ = 30.f;
75 bool simulatedPlaying_ =
false;
#define EVENGINE_API_ORCHESTRATION
const UnitySourceAsset & source
EVENGINE_API_FOUNDATION public API.
A playable audio source (static buffer or streaming decoder). Not thread-safe for playback control ex...
Localized voice assets, duration-based advance, and amplitude lip sync.
float getEnvelopeRate() const
Returns the envelope rate.
Module_REG(DialogueVoice)
std::string getCurrentLineId() const
Returns the current line id.