1 #ifndef SOUND_MANAGER_HPP
2 #define SOUND_MANAGER_HPP
5 #include <SDL2/SDL_mixer.h>
43 int startUp(
int frequency, Uint16 format,
int channels,
int chunksize)
45 Mix_OpenAudio(frequency, format, channels, chunksize);
46 fileMap.emplace(
"ThreeTone",
"./Assets/sound/ThreeTone_SFX.mp3");
47 fileMap.emplace(
"BrickHit",
"./Assets/sound/BrickHit_SFX.mp3");
48 fileMap.emplace(
"PaddleHit",
"./Assets/sound/PaddleBorderHit_SFX.mp3");
49 fileMap.emplace(
"Music",
"./Assets/sound/MusicTrack.mp3");
50 fileMap.emplace(
"SpookyMusic",
"./Assets/sound/Reflex_Nightmare_Trimmed.mp3");
59 std::shared_ptr<Mix_Chunk>
Load(
const std::string &path)
61 std::shared_ptr<Mix_Chunk> sound = std::shared_ptr<Mix_Chunk>(Mix_LoadWAV(path.c_str()));
64 SDL_LogError(SDL_LOG_CATEGORY_AUDIO,
"Mix_LoadWAV: %s", Mix_GetError());
69 SDL_Log(
"Allocated memory for: %s", path.c_str());
std::shared_ptr< Mix_Chunk > Load(const std::string &path)
Definition: SoundManager.hpp:59
std::map< std::string, std::string > fileMap
stores location of resources
Definition: ResourceManager.hpp:156
int startUp(int frequency, Uint16 format, int channels, int chunksize)
Definition: SoundManager.hpp:43
int shutDown()
Definition: ResourceManager.hpp:69
int shutDown()
Definition: SoundManager.hpp:26
static SoundManager & instance()
Definition: SoundManager.hpp:17
Definition: ResourceManager.hpp:62
Definition: SoundManager.hpp:11