-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAudioManager.h
More file actions
43 lines (33 loc) · 1.02 KB
/
AudioManager.h
File metadata and controls
43 lines (33 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#ifndef AUDIOMANAGER_H
#define AUDIOMANAGER_H
#include <SFML/Audio.hpp>
#include <string>
#include <iostream>
#include "Queue.h"
class AudioManager {
private:
sf::Music currentMusic;
sf::SoundBuffer jumpscareBuffer; // Buffer for jumpscare sound
sf::Sound jumpscareSound; // Sound object for jumpscare
Queue musicQueue;
public:
// Default constructor
AudioManager();
// Play music from the provided file path
void playMusic(const std::string& filePath, bool loop = true, float volume = 50.0f);
// Play jumpscare sound effect
void playJumpscareSound(const std::string& filePath, float volume = 100.0f);
// Stop the currently playing music
void stopMusic();
// Stop jumpscare sound
void stopJumpscareSound();
// Change the volume of the music
void setVolume(float volume);
// Method to enqueue music tracks
void enqueueTrack(const std::string& track);
// Play the next track in the queue
void playNextTrack();
// Destructor
~AudioManager();
};
#endif