8 Mixer::UnloadSound(m_ID);
25 std::shared_ptr<Sound>
Sound::Create(
const std::string& name,
const std::filesystem::path& path,
const bool preDecode) {
26 return std::shared_ptr<Sound>(
new Sound(name, path, preDecode));
29 std::shared_ptr<Sound>
Sound::Create(
const Descriptor& descriptor) {
30 return Create(descriptor.m_Name, descriptor.m_Path, descriptor.m_PreDecode);
33 Sound::Sound(std::string name,
const std::filesystem::path& path,
const bool preDecode): m_Name(std::move(name)), m_ID(s_NextIndex.fetch_add(1, std::memory_order_relaxed)) {
35 if (std::filesystem::exists(path)) {
36 auto result = Mixer::LoadSound(path, preDecode, m_ID);
#define CORI_CORE_DEBUG_TAGGED(...)
#define CORI_CORE_ERROR_TAGGED(...)
bool IsPlaceholder() const
Checks if the sound was created with a placeholder.
static std::shared_ptr< Sound > Create(const std::string &name, const std::filesystem::path &path, const bool preDecode=true)
Creates a Sound object.
SoundID GetID() const
Returns the SoundID associated with Sound.
bool IsValid() const
Check if the Sound is valid.
static std::filesystem::path GetAliasedPath(const std::string &alias)
Retries the full aliased path defined in fsgame.json.
Everything connected to audio is in this namespace.