add actual blow-into-mic sample that actually works
This commit is contained in:
parent
108647e033
commit
f79583bf16
|
@ -28,6 +28,8 @@
|
||||||
|
|
||||||
#include "NDS.h"
|
#include "NDS.h"
|
||||||
|
|
||||||
|
#include "mic_blow.h"
|
||||||
|
|
||||||
|
|
||||||
namespace Frontend
|
namespace Frontend
|
||||||
{
|
{
|
||||||
|
@ -92,19 +94,16 @@ void Mic_FeedSilence()
|
||||||
|
|
||||||
void Mic_FeedNoise()
|
void Mic_FeedNoise()
|
||||||
{
|
{
|
||||||
// note: DS games seem to expect very saturated 'blowing into mic' noise
|
int sample_len = sizeof(mic_blow) / sizeof(u16);
|
||||||
s16 noisesample[8] = {-0x8000, -0x8000, 0x7FFF, -0x8000, 0x7FFF, 0x7FFF, -0x8000, 0x7FFF};
|
static int sample_pos = 0;
|
||||||
int j = 0;
|
|
||||||
|
|
||||||
s16 tmp[735];
|
s16 tmp[735];
|
||||||
|
|
||||||
for (int i = 0; i < 735; i++)
|
for (int i = 0; i < 735; i++)
|
||||||
{
|
{
|
||||||
int val = noisesample[j];
|
tmp[i] = mic_blow[sample_pos];
|
||||||
j++;
|
sample_pos++;
|
||||||
if (j >= 8) j = rand() & 7;
|
if (sample_pos >= sample_len) sample_pos = 0;
|
||||||
|
|
||||||
tmp[i] = val;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
NDS::MicInputFrame(tmp, 735);
|
NDS::MicInputFrame(tmp, 735);
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -95,7 +95,7 @@
|
||||||
<string><html><head/><body><p>Noise will be forwarded to the emulated microphone, simulating blowing into the microphone.</p></body></html></string>
|
<string><html><head/><body><p>Noise will be forwarded to the emulated microphone, simulating blowing into the microphone.</p></body></html></string>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>White noise</string>
|
<string>Blow noise</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|
|
@ -12,6 +12,7 @@ SET(SOURCES_QT_SDL
|
||||||
../Util_ROM.cpp
|
../Util_ROM.cpp
|
||||||
../Util_Audio.cpp
|
../Util_Audio.cpp
|
||||||
../FrontendUtil.h
|
../FrontendUtil.h
|
||||||
|
../mic_blow.h
|
||||||
|
|
||||||
../../../melon.qrc
|
../../../melon.qrc
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue