Sound Bakery  v0.1.0
Open-source audio middleware for games
Loading...
Searching...
No Matches
sound.h
1#pragma once
2
3#include "miniaudio.h"
4#include "sound_bakery/core/core_include.h"
5
6namespace SB::Engine
7{
8 class SB_CLASS Sound : public SB::Core::DatabaseObject
9 {
10 public:
11 Sound();
12
13 void loadSynchronous();
14 void loadAsynchronous();
15
16 void setSoundName(std::string soundName);
17 std::string getSoundName() const;
18
19 void setEncodedSoundName(std::string path);
20 std::string getEncodedSoundName() const { return encodedSoundPath.string(); }
21
22 void setStreaming(bool streaming) { m_streaming = streaming; }
23 bool getIsStreaming() const { return m_streaming; }
24
25 sc_sound* getSound();
26
27 private:
28 std::unique_ptr<sc_sound, SC_SOUND_DELETER> m_sound;
29
30 std::filesystem::path rawSoundPath;
31 std::filesystem::path encodedSoundPath;
32
33 bool m_streaming;
34
35 REGISTER_REFLECTION(Sound, SB::Core::DatabaseObject)
36 RTTR_REGISTRATION_FRIEND
37 };
38} // namespace SB::Engine
Base object type for any object that can exist in the editor/database. Holds an ID and name.
Definition database_object.h:22
Definition sound.h:9
Definition sound_chef_common.h:161