summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Alexis Contreras <36680385+KiritoDv@users.noreply.github.com>2022-06-13 17:10:34 -0500
committerKevin Alexis Contreras <36680385+KiritoDv@users.noreply.github.com>2022-06-13 17:10:34 -0500
commit4ddb2d81b7b67bb832f41eeb8bdeeae3fcdedd87 (patch)
tree7c56ef3566cfd636afc15f70c405ed7c0c39b4d7
parentda724c0632074025d7e436801a31379cb35c7702 (diff)
parent405e6019d2af58257fb49b0e8a06f72f81d206a2 (diff)
Merge branch 'zapd_audio_support' into zelda64
-rw-r--r--libultraship/libultraship/WasapiAudioPlayer.cpp4
-rw-r--r--soh/assets/xml/GC_NMQ_D/audio/Audio.xml16
-rw-r--r--soh/soh/OTRGlobals.cpp3
-rw-r--r--soh/src/code/audio_init_params.c34
4 files changed, 30 insertions, 27 deletions
diff --git a/libultraship/libultraship/WasapiAudioPlayer.cpp b/libultraship/libultraship/WasapiAudioPlayer.cpp
index 7ec56b898..c4bea0b4f 100644
--- a/libultraship/libultraship/WasapiAudioPlayer.cpp
+++ b/libultraship/libultraship/WasapiAudioPlayer.cpp
@@ -30,8 +30,8 @@ namespace Ship {
WAVEFORMATEX desired;
desired.wFormatTag = WAVE_FORMAT_PCM;
desired.nChannels = 2;
- desired.nSamplesPerSec = 44000; // OTRTODO
- desired.nAvgBytesPerSec = 44000 * 2 * 2; // OTRTODO
+ desired.nSamplesPerSec = 44100;
+ desired.nAvgBytesPerSec = 44100 * 2 * 2;
desired.nBlockAlign = 4;
desired.wBitsPerSample = 16;
desired.cbSize = 0;
diff --git a/soh/assets/xml/GC_NMQ_D/audio/Audio.xml b/soh/assets/xml/GC_NMQ_D/audio/Audio.xml
index a7b0d1af4..801228b34 100644
--- a/soh/assets/xml/GC_NMQ_D/audio/Audio.xml
+++ b/soh/assets/xml/GC_NMQ_D/audio/Audio.xml
@@ -1339,13 +1339,13 @@
<Sample Name="Koto" SampleRate="28508">
<Offset Version="MQDebug" At="0x3926D0"/>
</Sample>
- <Sample Name="Some Manner of Drum?" SampleRate="32000">
+ <Sample Name="Some Manner of Drum" SampleRate="32000">
<Offset Version="MQDebug" At="0x396F80"/>
</Sample>
- <Sample Name="Another Type of Drum?" SampleRate="32000">
+ <Sample Name="Another Type of Drum" SampleRate="32000">
<Offset Version="MQDebug" At="0x397FA0"/>
</Sample>
- <Sample Name="Quick Drum?" SampleRate="32000">
+ <Sample Name="Quick Drum" SampleRate="32000">
<Offset Version="MQDebug" At="0x399790"/>
</Sample>
<Sample Name="Gong" SampleRate="32000">
@@ -1435,13 +1435,13 @@
<Sample Name="Low Rumbling">
<Offset Version="MQDebug" At="0"/>
</Sample>
- <Sample Name="Drum Sidestick?">
+ <Sample Name="Drum Sidestick">
<Offset Version="MQDebug" At="0xA590"/>
</Sample>
- <Sample Name="Low Drum?">
+ <Sample Name="Low Drum">
<Offset Version="MQDebug" At="0x8BC0"/>
</Sample>
- <Sample Name="Sweep Pad?">
+ <Sample Name="Sweep Pad">
<Offset Version="MQDebug" At="0xB3B0"/>
</Sample>
<Sample Name="Organic Gurgling">
@@ -1470,7 +1470,7 @@
<Sample Name="Goron Drum">
<Offset Version="MQDebug" At="0"/>
</Sample>
- <Sample Name="Bass Slap?">
+ <Sample Name="Bass Slap">
<Offset Version="MQDebug" At="0x2540"/>
</Sample>
<Sample Name="Goron Ooh">
@@ -1503,7 +1503,7 @@
<Sample Name="Gong">
<Offset Version="MQDebug" At="0x12EB0"/>
</Sample>
- <Sample Name="Bass Slap?">
+ <Sample Name="Bass Slap">
<Offset Version="MQDebug" At="0x1D3E0"/>
</Sample>
<Sample Name="Windchimes">
diff --git a/soh/soh/OTRGlobals.cpp b/soh/soh/OTRGlobals.cpp
index 46165838b..f5413e3c5 100644
--- a/soh/soh/OTRGlobals.cpp
+++ b/soh/soh/OTRGlobals.cpp
@@ -679,6 +679,9 @@ extern "C" SoundFontSample* ResourceMgr_LoadAudioSample(const char* path) {
sampleC->loop->end = sample->loop.end;
sampleC->loop->count = sample->loop.count;
+ for (int i = 0; i < 16; i++)
+ sampleC->loop->state[i] = 0;
+
for (int i = 0; i < sample->loop.states.size(); i++)
sampleC->loop->state[i] = sample->loop.states[i];
diff --git a/soh/src/code/audio_init_params.c b/soh/src/code/audio_init_params.c
index b4b8890b4..3b21d4cbc 100644
--- a/soh/src/code/audio_init_params.c
+++ b/soh/src/code/audio_init_params.c
@@ -72,22 +72,22 @@ ReverbSettings D_80133420[][3] = {
// OTRTODO
AudioSpec gAudioSpecs[18] = {
- { 44000, 1, 24, 4, 0, 0, 2, D_80133420[0], 0x300, 0x200, 0x7FFF, 0x7F0, 0xE00, 0, 0x4000, 0x2880, 0, 0, 0 },
- { 44000, 1, 24, 4, 0, 0, 2, D_80133420[1], 0x300, 0x200, 0x7FFF, 0x7F0, 0xE00, 0, 0x3800, 0x2880, 0, 0, 0 },
- { 44000, 1, 24, 4, 0, 0, 2, D_80133420[2], 0x300, 0x200, 0x7FFF, 0x7F0, 0xE00, 0, 0x3800, 0x2880, 0, 0, 0 },
- { 44000, 1, 23, 4, 0, 0, 2, D_80133420[4], 0x300, 0x200, 0x7FFF, 0x7F0, 0xE00, 0, 0x3800, 0x2880, 0, 0, 0 },
- { 44000, 1, 23, 4, 0, 0, 2, D_80133420[5], 0x300, 0x200, 0x7FFF, 0x7F0, 0xE00, 0, 0x3800, 0x2880, 0, 0, 0 },
- { 44000, 1, 24, 4, 0, 0, 2, D_80133420[6], 0x300, 0x200, 0x7FFF, 0x7F0, 0xE00, 0, 0x3800, 0x2880, 0, 0, 0 },
- { 44000, 1, 24, 4, 0, 0, 2, D_80133420[7], 0x300, 0x200, 0x7FFF, 0x7F0, 0xE00, 0, 0x3800, 0x2880, 0, 0, 0 },
- { 44000, 1, 23, 4, 0, 0, 2, D_80133420[8], 0x300, 0x200, 0x7FFF, 0x7F0, 0xE00, 0, 0x3800, 0x2880, 0, 0, 0 },
- { 44000, 1, 24, 4, 0, 0, 2, D_80133420[9], 0x300, 0x200, 0x7FFF, 0x7F0, 0xE00, 0, 0x3800, 0x2880, 0, 0, 0 },
- { 44000, 1, 23, 4, 0, 0, 2, D_80133420[8], 0x300, 0x200, 0x7FFF, 0x7F0, 0xE00, 0, 0x3800, 0x2880, 0, 0, 0 },
- { 44000, 1, 28, 3, 0, 0, 2, D_80133420[10], 0x300, 0x200, 0x7FFF, 0x7F0, 0xE00, 0, 0x2800, 0x2880, 0, 0, 0 },
- { 44000, 1, 28, 3, 0, 0, 1, D_80133420[11], 0x300, 0x200, 0x7FFF, 0, 0x4800, 0, 0x4000, 0, 0, 0, 0 },
- { 44000, 1, 28, 3, 0, 0, 1, D_80133420[11], 0x300, 0x200, 0x7FFF, 0, 0, 0, 0x4000, 0x4800, 0, 0, 0 },
- { 44000, 1, 22, 4, 0, 0, 2, D_80133420[0], 0x300, 0x200, 0x7FFF, 0x7F0, 0xE00, 0, 0x3800, 0x2880, 0, 0, 0 },
- { 44000, 1, 22, 4, 0, 0, 2, D_80133420[8], 0x300, 0x200, 0x7FFF, 0x7F0, 0xE00, 0, 0x3800, 0x2880, 0, 0, 0 },
- { 44000, 1, 16, 4, 0, 0, 2, D_80133420[0], 0x300, 0x200, 0x7FFF, 0x7F0, 0xE00, 0, 0x3800, 0x2880, 0, 0, 0 },
+ { 44100, 1, 24, 4, 0, 0, 2, D_80133420[0], 0x300, 0x200, 0x7FFF, 0x7F0, 0xE00, 0, 0x4000, 0x2880, 0, 0, 0 },
+ { 44100, 1, 24, 4, 0, 0, 2, D_80133420[1], 0x300, 0x200, 0x7FFF, 0x7F0, 0xE00, 0, 0x3800, 0x2880, 0, 0, 0 },
+ { 44100, 1, 24, 4, 0, 0, 2, D_80133420[2], 0x300, 0x200, 0x7FFF, 0x7F0, 0xE00, 0, 0x3800, 0x2880, 0, 0, 0 },
+ { 44100, 1, 23, 4, 0, 0, 2, D_80133420[4], 0x300, 0x200, 0x7FFF, 0x7F0, 0xE00, 0, 0x3800, 0x2880, 0, 0, 0 },
+ { 44100, 1, 23, 4, 0, 0, 2, D_80133420[5], 0x300, 0x200, 0x7FFF, 0x7F0, 0xE00, 0, 0x3800, 0x2880, 0, 0, 0 },
+ { 44100, 1, 24, 4, 0, 0, 2, D_80133420[6], 0x300, 0x200, 0x7FFF, 0x7F0, 0xE00, 0, 0x3800, 0x2880, 0, 0, 0 },
+ { 44100, 1, 24, 4, 0, 0, 2, D_80133420[7], 0x300, 0x200, 0x7FFF, 0x7F0, 0xE00, 0, 0x3800, 0x2880, 0, 0, 0 },
+ { 44100, 1, 23, 4, 0, 0, 2, D_80133420[8], 0x300, 0x200, 0x7FFF, 0x7F0, 0xE00, 0, 0x3800, 0x2880, 0, 0, 0 },
+ { 44100, 1, 24, 4, 0, 0, 2, D_80133420[9], 0x300, 0x200, 0x7FFF, 0x7F0, 0xE00, 0, 0x3800, 0x2880, 0, 0, 0 },
+ { 44100, 1, 23, 4, 0, 0, 2, D_80133420[8], 0x300, 0x200, 0x7FFF, 0x7F0, 0xE00, 0, 0x3800, 0x2880, 0, 0, 0 },
+ { 44100, 1, 28, 3, 0, 0, 2, D_80133420[10], 0x300, 0x200, 0x7FFF, 0x7F0, 0xE00, 0, 0x2800, 0x2880, 0, 0, 0 },
+ { 44100, 1, 28, 3, 0, 0, 1, D_80133420[11], 0x300, 0x200, 0x7FFF, 0, 0x4800, 0, 0x4000, 0, 0, 0, 0 },
+ { 44100, 1, 28, 3, 0, 0, 1, D_80133420[11], 0x300, 0x200, 0x7FFF, 0, 0, 0, 0x4000, 0x4800, 0, 0, 0 },
+ { 44100, 1, 22, 4, 0, 0, 2, D_80133420[0], 0x300, 0x200, 0x7FFF, 0x7F0, 0xE00, 0, 0x3800, 0x2880, 0, 0, 0 },
+ { 44100, 1, 22, 4, 0, 0, 2, D_80133420[8], 0x300, 0x200, 0x7FFF, 0x7F0, 0xE00, 0, 0x3800, 0x2880, 0, 0, 0 },
+ { 44100, 1, 16, 4, 0, 0, 2, D_80133420[0], 0x300, 0x200, 0x7FFF, 0x7F0, 0xE00, 0, 0x3800, 0x2880, 0, 0, 0 },
{ 22050, 1, 24, 4, 0, 0, 2, D_80133420[0], 0x300, 0x200, 0x7FFF, 0x7F0, 0xE00, 0, 0x3800, 0x2880, 0, 0, 0 },
- { 44000, 1, 24, 4, 0, 0, 2, D_80133420[2], 0x300, 0x200, 0x7FFF, 0x7F0, 0xE00, 0, 0x3600, 0x2600, 0, 0, 0 },
+ { 44100, 1, 24, 4, 0, 0, 2, D_80133420[2], 0x300, 0x200, 0x7FFF, 0x7F0, 0xE00, 0, 0x3600, 0x2600, 0, 0, 0 },
};