11#include <unordered_map>
22 const std::string& file_path,
const std::string& name,
27 const std::string& file_path,
28 const std::string& name =
"") const noexcept;
31 std::shared_ptr<
SoundResource> sound_resource,
float volume = 1.0
f,
43 const std::
string& name) const;
53 std::unordered_map<std::
string, std::shared_ptr<
SoundResource>>
55 std::vector<std::unique_ptr<
SoundInstance>> active_instances_;
Manages audio playback and sound instances within the engine.
Definition audio_service.h:17
void stop_sound(SoundInstance &instance)
bool has_sound_instance(const std::string &name) const noexcept
std::vector< std::reference_wrapper< SoundInstance > > get_all_playing_sounds() const
std::reference_wrapper< SoundInstance > play_sound(std::shared_ptr< SoundResource > sound_resource, float volume=1.0f, bool loop=false)
void update()
Updates the audio manager, meaning it cleans up finished sounds.
std::optional< std::shared_ptr< SoundResource > > get_sound_resource(const std::string &file_path, const std::string &name="") const noexcept
bool unregister_sound(const std::string &name)
std::optional< std::shared_ptr< SoundResource > > register_sound(const std::string &file_path, const std::string &name, SoundType type=SoundType::GENERIC)
std::optional< std::reference_wrapper< SoundInstance > > get_sound_instance(const std::string &name) const
Definition iEngineService.h:4
Represents an instance of a generic sound within the audio system. The reason for separating SoundIns...
Definition sound_instance.h:14
Represents a generic sound resource in the audio engine. This class serves as a base for specific sou...
Definition sound_resource.h:12
SoundType
Definition sound_type.h:5