diff --git a/src/Common/Game/IW4/IW4_Assets.h b/src/Common/Game/IW4/IW4_Assets.h index 36ac21bf..fe22c0ad 100644 --- a/src/Common/Game/IW4/IW4_Assets.h +++ b/src/Common/Game/IW4/IW4_Assets.h @@ -1783,12 +1783,40 @@ namespace IW4 char* data; }; + // https://learn.microsoft.com/en-us/windows/win32/api/mmeapi/ns-mmeapi-waveformatex + struct XAudioWaveFormatEx + { + uint16_t wFormatTag; + uint16_t nChannels; + uint32_t nSamplesPerSec; + uint32_t nAvgBytesPerSec; + uint16_t nBlockAlign; + uint16_t wBitsPerSample; + uint16_t cbSize; + uint16_t probablyPadding; + }; + + struct XAudio2Sound + { + XAudioWaveFormatEx waveFormat; + uint8_t unknown_18[4]; + unsigned int data_len; + uint8_t unknown_28[20]; + char* data; + }; + struct LoadedSound { const char* name; MssSound sound; }; + struct LoadedSound_64 + { + const char* name; + XAudio2Sound sound; + }; + struct StreamedSound { const char* dir; diff --git a/src/ZoneCode/Game/IW4/IW4_Commands.txt b/src/ZoneCode/Game/IW4/IW4_Commands.txt index ac0b4325..ba15caa9 100644 --- a/src/ZoneCode/Game/IW4/IW4_Commands.txt +++ b/src/ZoneCode/Game/IW4/IW4_Commands.txt @@ -18,6 +18,7 @@ asset GfxImage AssetImage; asset snd_alias_list_t AssetSound; asset SndCurve AssetSoundCurve; asset LoadedSound AssetLoadedSound; +asset LoadedSound_64 AssetLoadedSound; asset clipMap_t AssetClipMapMp; asset ComWorld AssetComWorld; asset GameWorldSp AssetGameWorldSp; diff --git a/src/ZoneCode/Game/IW4/XAssets/LoadedSound.txt b/src/ZoneCode/Game/IW4/XAssets/LoadedSound.txt index d9131522..40a27e19 100644 --- a/src/ZoneCode/Game/IW4/XAssets/LoadedSound.txt +++ b/src/ZoneCode/Game/IW4/XAssets/LoadedSound.txt @@ -4,6 +4,17 @@ use LoadedSound; set block XFILE_BLOCK_TEMP; set string name; +set variant pc32; + +use LoadedSound_64; +set block XFILE_BLOCK_TEMP; +set string name; +set variant pc64; + +// XAudio2Sound +use XAudio2Sound; +set reusable data; +set count data data_len; // MssSound use MssSound; @@ -12,4 +23,4 @@ set reusable data; set count data info::data_len; set condition info::data_ptr never; set condition info::initial_ptr never; -set action SetSoundData(MssSound); \ No newline at end of file +set action SetSoundData(MssSound);