58 "| Loops : " << params.
Loops <<
" |" <<
68 std::string out =
"\n" +
69 std::string(
"| Loops : ") + std::to_string(
Loops) +
" |" +
70 std::string(
"| MaxMilliseconds : ") + std::to_string(
MaxMilliseconds) +
" |" +
71 std::string(
"| StartMillisecond : ") + std::to_string(
StartMillisecond) +
" |" +
106 static std::expected<void, Core::CoriError<>>
SetMasterGain(
const float gain);
134 static std::expected<void, Core::CoriError<>>
StopTag(
const char* tag,
const int64_t fadeOutMS = 0);
143 static std::expected<void, Core::CoriError<>>
PauseTag(
const char* tag);
150 static std::expected<void, Core::CoriError<>>
ResumeTag(
const char* tag);
161 static std::expected<void, Core::CoriError<>>
SetTagGain(
const char* tag,
const float gain);
169 static void Shutdown();
171 static std::expected<void, Core::CoriError<std::filesystem::path>> LoadSound(
const std::filesystem::path& path,
const bool preDecode,
const SoundID soundID);
173 static void UnloadSound(
const SoundID soundID);
175 static std::expected<void, Core::CoriError<>> CreateTrack(Track* track);
177 static void DestroyTrack(
const TrackID trackID);
179 static std::expected<void, Core::CoriError<>> SetTrackSound(
const TrackID trackID,
const Sound* sound);
181 static std::expected<void, Core::CoriError<>> PlayTrack(
const TrackID trackID,
const PlayParams& params = {});
183 static std::expected<void, Core::CoriError<>> StopTrack(
const TrackID trackID,
const int64_t fadeOutMS = 0);
185 static std::expected<void, Core::CoriError<>> PauseTrack(
const TrackID trackID);
187 static std::expected<void, Core::CoriError<>> ResumeTrack(
const TrackID trackID);
189 static bool IsTrackPaused(
const TrackID trackID);
191 static bool IsTrackPlaying(
const TrackID trackID);
193 static std::expected<void, Core::CoriError<>> SetTrackGain(
const TrackID trackID,
const float gain);
195 static float GetTrackGain(
const TrackID trackID);
197 static std::expected<void, Core::CoriError<>> TagTrack(
const TrackID trackID,
const char* tag);
199 static void UntagTrack(
const TrackID trackID,
const char* tag);
201 static std::expected<int64_t, Core::CoriError<>> MillisecondsToFrames(
const TrackID trackID,
const float milliseconds);
Mixer is responsible for mixing all the sounds, it is a global object and there can only be one Mixer...
static std::expected< void, Core::CoriError<> > SetTagGain(const char *tag, const float gain)
Sets the gain of all tracks with a specific tag.
static std::expected< void, Core::CoriError<> > SetMasterGain(const float gain)
Sets the master gain of a Mixer.
static std::expected< void, Core::CoriError<> > StartTag(const char *tag, const PlayParams ¶ms=PlayParams{})
Start (ot restart) mixing all Tracks with a specific tag.
static float GetMasterGain()
Returns the current master gain specified for the Mixer. The default gain for a Mixer is 1....
static std::expected< void, Core::CoriError<> > ResumeTag(const char *tag)
Resumes all Tracks with a specific tag.
static std::expected< void, Core::CoriError<> > PauseAllTracks()
Pauses all Track that are currently playing on the Mixer.
static std::expected< void, Core::CoriError<> > PauseTag(const char *tag)
Pauses all tracks with a specific tag.
static std::expected< void, Core::CoriError<> > ResumeAllTracks()
Resumes all Track that are currently paused on the Mixer.
static std::expected< void, Core::CoriError<> > StopTag(const char *tag, const int64_t fadeOutMS=0)
Stops all Track with a specific tab, possibly fading out over time.
Sound asset to be played on a Track.
You use Track to play and mix Sound objects.
Main Application object, there can only be one Application object. Basically a root of the program.
Everything connected to audio is in this namespace.
Core systems of the engine are here.
Parameters to be used when playing sound, you can mix your audio playback however you want with these...
float MaxMilliseconds
Mix at most n milliseconds. Default -1.0f, mixes all available audio.
friend std::ostream & operator<<(std::ostream &os, const PlayParams ¶ms)
std::string ToString() const
bool LoopedInSequence
This value is used to define a sequence looping point when passing a sequence to Track::Play,...
int32_t Loops
Number of times to loop the track when it reaches the end. A value of -1 will result in an infinite l...
float LoopStartMillisecond
Start looping at n'th millisecond. Values <=0 will result in looping from the very beginning of the t...
float FadeInMilliseconds
Fade in the audio over n milliseconds. Will start from silence and reach full volume smoothly....
float StartMillisecond
Start mixing at n'th millisecond. Values <=0 will result in mixing from the very beginning of the tra...
float AppendSilenceMilliseconds
Append n milliseconds to the end of a track after all loops (specified in PlayParams::Loops) are comp...