Need the hit.wav to be mono, but now we have a sound we can move around, just not sure how to place it based on the visuals.

This commit is contained in:
Zed A. Shaw 2024-10-28 19:46:55 -04:00
parent 9102bdc8ad
commit 4ed06b10b1
11 changed files with 144 additions and 41 deletions

21
sound.hpp Normal file
View file

@ -0,0 +1,21 @@
#pragma once
#include <string>
#include <filesystem>
#include <unordered_map>
#include <SFML/Audio.hpp>
struct SoundPair {
sf::SoundBuffer buffer;
sf::Sound sound;
};
struct SoundManager {
std::filesystem::path $base_path;
std::unordered_map<std::string, SoundPair*> $sounds;
SoundManager(std::string base_path);
void load(const std::string name, const std::string path);
void play(const std::string name);
void playAt(const std::string name, float x, float y, float z);
};