From c13d09268f4e9e5bad39e558ef444af00585b530 Mon Sep 17 00:00:00 2001 From: cat Date: Wed, 3 Sep 2025 19:56:33 +0300 Subject: [PATCH] Added Engine and Sound with basic controls --- src/Audio.cpp | 3 --- src/ChargeAudio.hpp | 34 +++++++++++++++++++++++++++++++++- 2 files changed, 33 insertions(+), 4 deletions(-) delete mode 100644 src/Audio.cpp diff --git a/src/Audio.cpp b/src/Audio.cpp deleted file mode 100644 index ec5455c..0000000 --- a/src/Audio.cpp +++ /dev/null @@ -1,3 +0,0 @@ -#include "ChargeAudio.hpp" - -int placeHolder() { return 0; } diff --git a/src/ChargeAudio.hpp b/src/ChargeAudio.hpp index a4c4cf3..6b59631 100644 --- a/src/ChargeAudio.hpp +++ b/src/ChargeAudio.hpp @@ -1 +1,33 @@ -int placeHolder(); +#include "../lib/miniaudio/miniaudio.c" +#include "../lib/miniaudio/miniaudio.h" +#include + +namespace ChargeAudio { +class Sound { +public: + ~Sound(); + void Play(); + void Pause(); + void Reset(); + void SetVolume(float value); + float GetVolume(); + +private: + Sound(); + class Engine *baseEngine; + ma_sound maSound; + friend class Engine; +}; + +class Engine { +public: + Engine(); + Sound CreateSound(std::string filepath); + void SetVolume(float value); + float GetVolume(); + +private: + ma_engine maEngine; + ma_result maResponse; +}; +} // namespace ChargeAudio