Sound Bakery  v0.1.0
Open-source audio middleware for games
Loading...
Searching...
No Matches
sound.h
1#pragma once
2
5#include "sound_bakery/core/core_include.h"
6
7namespace sbk::engine
8{
12 struct SB_CLASS encoding_sound
13 {
14 std::filesystem::path rawSoundPath;
15 std::filesystem::path encodedSoundPath;
16 sc_encoding_format encodingFormat = sc_encoding_format_wav;
17 };
18
19 class SB_CLASS sound : public sbk::core::database_object
20 {
21 public:
22 sound();
23
24 void loadSynchronous();
25 void loadAsynchronous();
26
27 void setSoundName(std::string soundName);
28 std::string getSoundName() const;
29
30 void setEncodedSoundName(std::string path);
31 std::string getEncodedSoundName() const { return encodedSoundPath.string(); }
32
33 void setStreaming(bool streaming) { m_streaming = streaming; }
34 bool getIsStreaming() const { return m_streaming; }
35
36 sc_sound* getSound();
37
38 encoding_sound get_encoding_sound_data() const;
39
40 private:
41 std::unique_ptr<sc_sound, SC_SOUND_DELETER> m_sound;
42
43 std::filesystem::path rawSoundPath;
44 std::filesystem::path encodedSoundPath;
45
46 sc_encoding_format m_encodingFormat = sc_encoding_format_wav;
47
48 bool m_streaming = false;
49
50 REGISTER_REFLECTION(sound, sbk::core::database_object)
51 RTTR_REGISTRATION_FRIEND
52 };
53} // namespace sbk::engine
Base object type for any object that can exist in the editor/database. Holds an ID and name.
Definition database_object.h:12
Definition sound.h:20
A wrapper library for miniaudio that emulates functionality of FMOD.
Provides extensions to miniaudio's encoding API.
Data for converting a sound to an encoded format.
Definition sound.h:13
Definition sound_chef_common.h:188