Merge pull request #13182 from jordan-woyak/wiimote-speaker-remove-dumping-code

WiimoteEmu: Remove disabled and no-longer-compiling wav dumping code.
This commit is contained in:
Tilka 2024-11-08 22:53:56 +00:00 committed by GitHub
commit 97ea64164b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -8,21 +8,12 @@
#include "AudioCommon/AudioCommon.h" #include "AudioCommon/AudioCommon.h"
#include "Common/CommonTypes.h" #include "Common/CommonTypes.h"
#include "Common/Logging/Log.h" #include "Common/Logging/Log.h"
#include "Common/MathUtil.h"
#include "Core/ConfigManager.h" #include "Core/ConfigManager.h"
#include "Core/HW/WiimoteEmu/WiimoteEmu.h" #include "Core/HW/WiimoteEmu/WiimoteEmu.h"
#include "Core/System.h" #include "Core/System.h"
#include "InputCommon/ControllerEmu/ControlGroup/ControlGroup.h" #include "InputCommon/ControllerEmu/ControlGroup/ControlGroup.h"
#include "InputCommon/ControllerEmu/Setting/NumericSetting.h" #include "InputCommon/ControllerEmu/Setting/NumericSetting.h"
//#define WIIMOTE_SPEAKER_DUMP
#ifdef WIIMOTE_SPEAKER_DUMP
#include <cstdlib>
#include <fstream>
#include "AudioCommon/WaveFile.h"
#include "Common/FileUtil.h"
#endif
namespace WiimoteEmu namespace WiimoteEmu
{ {
// Yamaha ADPCM decoder code based on The ffmpeg Project (Copyright (s) 2001-2003) // Yamaha ADPCM decoder code based on The ffmpeg Project (Copyright (s) 2001-2003)
@ -60,17 +51,6 @@ static s16 adpcm_yamaha_expand_nibble(ADPCMState& s, u8 nibble)
return s.predictor; return s.predictor;
} }
#ifdef WIIMOTE_SPEAKER_DUMP
std::ofstream ofile;
WaveFileWriter wav;
void stopdamnwav()
{
wav.Stop();
ofile.close();
}
#endif
void SpeakerLogic::SpeakerData(const u8* data, int length, float speaker_pan) void SpeakerLogic::SpeakerData(const u8* data, int length, float speaker_pan)
{ {
// TODO: should we still process samples for the decoder state? // TODO: should we still process samples for the decoder state?
@ -151,28 +131,6 @@ void SpeakerLogic::SpeakerData(const u8* data, int length, float speaker_pan)
const unsigned int sample_rate = sample_rate_dividend / reg_data.sample_rate; const unsigned int sample_rate = sample_rate_dividend / reg_data.sample_rate;
sound_stream->GetMixer()->PushWiimoteSpeakerSamples( sound_stream->GetMixer()->PushWiimoteSpeakerSamples(
samples.get(), sample_length, Mixer::FIXED_SAMPLE_RATE_DIVIDEND / (sample_rate * 2)); samples.get(), sample_length, Mixer::FIXED_SAMPLE_RATE_DIVIDEND / (sample_rate * 2));
#ifdef WIIMOTE_SPEAKER_DUMP
static int num = 0;
if (num == 0)
{
File::Delete("rmtdump.wav");
File::Delete("rmtdump.bin");
atexit(stopdamnwav);
File::OpenFStream(ofile, "rmtdump.bin", ofile.binary | ofile.out);
wav.Start("rmtdump.wav", 6000);
}
wav.AddMonoSamples(samples.get(), length * 2);
if (ofile.good())
{
for (int i = 0; i < length; i++)
{
ofile << data[i];
}
}
num++;
#endif
} }
void SpeakerLogic::Reset() void SpeakerLogic::Reset()