1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-12-23 20:29:42 +00:00

Corrects stereo audio generation.

This commit is contained in:
Thomas Harte 2020-02-16 00:19:49 -05:00
parent e66a3523b6
commit f760a68173

View File

@ -223,13 +223,13 @@ template <bool is_stereo> void AY38910::evaluate_output_volume() {
// Mix additively, weighting if in stereo.
if constexpr (is_stereo) {
int16_t *const volumes = reinterpret_cast<int16_t *>(&output_volume_);
volumes[0] = int16_t((
int16_t *const output_volumes = reinterpret_cast<int16_t *>(&output_volume_);
output_volumes[0] = int16_t((
volumes_[volumes[0]] * channel_levels[0] * a_left_ +
volumes_[volumes[1]] * channel_levels[1] * b_left_ +
volumes_[volumes[2]] * channel_levels[2] * c_left_
) >> 8);
volumes[1] = int16_t((
output_volumes[1] = int16_t((
volumes_[volumes[0]] * channel_levels[0] * a_right_ +
volumes_[volumes[1]] * channel_levels[1] * b_right_ +
volumes_[volumes[2]] * channel_levels[2] * c_right_