From 8398eb16b8996df7093960bb0a5d7fc65b8229d4 Mon Sep 17 00:00:00 2001 From: GuglioIsStupid Date: Thu, 5 Mar 2026 19:48:12 -0500 Subject: Miniaudio Implementation (+stb_vorbis) (#624) * Miniaudio Implementation * Do not link miles + remove miles lib --- Minecraft.Client/Common/Audio/SoundEngine.h | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) (limited to 'Minecraft.Client/Common/Audio/SoundEngine.h') diff --git a/Minecraft.Client/Common/Audio/SoundEngine.h b/Minecraft.Client/Common/Audio/SoundEngine.h index 92c99d23..5bd2fe4b 100644 --- a/Minecraft.Client/Common/Audio/SoundEngine.h +++ b/Minecraft.Client/Common/Audio/SoundEngine.h @@ -4,6 +4,8 @@ class Options; using namespace std; #include "..\..\Minecraft.World\SoundTypes.h" +#include "miniaudio.h" + enum eMUSICFILES { eStream_Overworld_Calm1 = 0, @@ -76,7 +78,11 @@ enum MUSIC_STREAMSTATE typedef struct { + #ifndef _WINDOWS64 F32 x,y,z,volume,pitch; + #else + float x,y,z,volume,pitch; + #endif int iSound; bool bIs3D; bool bUseSoundsPitchVal; @@ -86,6 +92,17 @@ typedef struct } AUDIO_INFO; +#ifdef _WINDOWS64 +struct MiniAudioSound +{ + ma_sound sound; + AUDIO_INFO info; + bool active; +}; + +extern std::vector m_activeSounds; +#endif + class SoundEngine : public ConsoleSoundEngine { static const int MAX_SAME_SOUNDS_PLAYING = 8; // 4J added @@ -112,7 +129,7 @@ public: int getMusicID(int iDomain); int getMusicID(const wstring& name); void SetStreamingSounds(int iOverworldMin, int iOverWorldMax, int iNetherMin, int iNetherMax, int iEndMin, int iEndMax, int iCD1); - void updateMiles(); // AP added so Vita can update all the Miles functions during the mixer callback + void updateMiniAudio(); void playMusicUpdate(); private: @@ -126,9 +143,10 @@ private: int GetRandomishTrack(int iStart,int iEnd); - HMSOUNDBANK m_hBank; - HDIGDRIVER m_hDriver; - HSTREAM m_hStream; + ma_engine m_engine; + ma_engine_config m_engineConfig; + ma_sound m_musicStream; + bool m_musicStreamActive; static char m_szSoundPath[]; static char m_szMusicPath[]; @@ -165,4 +183,4 @@ private: #ifdef __ORBIS__ int32_t m_hBGMAudio; #endif -}; +}; \ No newline at end of file -- cgit v1.2.3