add actual blow-into-mic sample that actually works

This commit is contained in:
Arisotura 2020-05-21 02:33:48 +02:00
parent 108647e033
commit f79583bf16
4 changed files with 5548 additions and 9 deletions

View File

@ -28,6 +28,8 @@
#include "NDS.h"
#include "mic_blow.h"
namespace Frontend
{
@ -92,19 +94,16 @@ void Mic_FeedSilence()
void Mic_FeedNoise()
{
// note: DS games seem to expect very saturated 'blowing into mic' noise
s16 noisesample[8] = {-0x8000, -0x8000, 0x7FFF, -0x8000, 0x7FFF, 0x7FFF, -0x8000, 0x7FFF};
int j = 0;
int sample_len = sizeof(mic_blow) / sizeof(u16);
static int sample_pos = 0;
s16 tmp[735];
for (int i = 0; i < 735; i++)
{
int val = noisesample[j];
j++;
if (j >= 8) j = rand() & 7;
tmp[i] = val;
tmp[i] = mic_blow[sample_pos];
sample_pos++;
if (sample_pos >= sample_len) sample_pos = 0;
}
NDS::MicInputFrame(tmp, 735);

5539
src/frontend/mic_blow.h Normal file

File diff suppressed because it is too large Load Diff

View File

@ -95,7 +95,7 @@
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Noise will be forwarded to the emulated microphone, simulating blowing into the microphone.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>White noise</string>
<string>Blow noise</string>
</property>
</widget>
</item>

View File

@ -12,6 +12,7 @@ SET(SOURCES_QT_SDL
../Util_ROM.cpp
../Util_Audio.cpp
../FrontendUtil.h
../mic_blow.h
../../../melon.qrc
)