This should reduce (but not completely eliminate) gradual audio desyncs in dumps. This also allows for accurate sample rates for the GameCube.
Completely eliminating gradual audio desyncs will require resampling to an integer sample rate, as nothing seems to support a non-integer sample rate.
SPDX standardizes how source code conveys its copyright and licensing
information. See https://spdx.github.io/spdx-spec/1-rationale/ . SPDX
tags are adopted in many large projects, including things like the Linux
kernel.
The main problem was that the volume of the mixer wasn't savestated.
The volume is typically 0 at the beginning of a game, so loading a
savestate at the beginning of a game would lead to silent DTK audio.
I also added savestating to StreamADPCM.cpp.
We had to lock audiocommon with the old asynchron HLE audio emulation,
now our Mixer is just a plain FIFO which may underrun.
Of course, this will stutter, but underruning the audio backend is likely worse.
For more information:
https://docs.google.com/document/d/1tBEgsJh7QiwNwepXI0eobfK3U8LkJButSyeuFt1degM/edit?usp=sharing
removed: SSE includes (not used)
added: 16bit -> float -> 16bit functions
added: linear interpolator and high-quality (windowed-sinc) interpolator functions (including Resampler class)
added: dithering
changed: renamed variables and reformatted a few things to fit with style guide (braces, #include->const)
changed: use s16, u16, s32, u32 etc
changed: store samples and do all computations as floats
changed: volume from 0 - 255
Each emulated Wiimote can have its speaker routed from left to right via the "Speaker Pan" setting in the emulated wiimote settings dialog. Use any value from -127 for leftmost to 127 for rightmost with 0 being the centre.
Added code in the InputConfig to use a spin control for non-boolean values.
Defaulted the setting of "Enable Speaker Data" to disabled.
The Wiimotes are positioned as follows:
Wiimote 0 = Center
Wiimote 1 = Left
Wiimote 2 = Right
Wiimote 3 = Center
The Wiimote speaker output can be disabled via the "Enable Speaker Data" checkbox in the Wiimote settings.
The two instances of this class were sharing a frac variable causing
audio glitches when both were running (which is now all the time).
Fixes issue 7463 (Since DTK merge, audio has staic in it).
The primary motivation here is to make sure we submit samples from the
CPU thread. This makes sure the timing of related interrupts accurate,
and generally keeps the different kinds of audio synchronized. This will also
allow improvements to audio dumping functionality.
The new code is also more concise because it gets rid of some duplicated
audio mixing code.