weihuoya / citra

A Nintendo 3DS Emulator
https://citra-emu.org
GNU General Public License v2.0
2k stars 188 forks source link

fix(audio_core): optimize audio input #847

Closed hitvery closed 8 months ago

hitvery commented 9 months ago

Try to fix the issue https://github.com/weihuoya/citra/issues/828

Motivate

Some Android phone microphones may optimize for reducing noise, or their microphone is not as sensitive as 3ds. Because of this reason, some games will not detect blowing while the input audio signal value is small and can not reach the threshold.

Solution

So I just increased the volume from the audio input device. I tested this change on Wario Gold and Captain Toad. I also increased the static noise volume. But maybe it is better to add this audio input volume parameter to the config.ini file, and add some UI for this config? I am not familiar with this tech, maybe you can modify my code to improve it, thanks!

Others

I also fix a crash bug by updating submodule external/cubeb to the latest commit. A simple uninitialized parameter bug in externals\cubeb\src\cubeb_aaudio.cpp. Crash point: image The stm->sample_rate should init as zero. The latest version has fixed it, see https://github.com/mozilla/cubeb/commit/dfc128b0536d947990bae2d3ea38fc0fa0827796, line 159.

weihuoya commented 8 months ago

Thanks a lot, it works. https://github.com/weihuoya/citra/releases/tag/20231010