mirror of
https://github.com/TomHarte/CLK.git
synced 2024-12-25 03:32:01 +00:00
Corrects stereo audio generation.
This commit is contained in:
parent
e66a3523b6
commit
f760a68173
@ -223,13 +223,13 @@ template <bool is_stereo> void AY38910::evaluate_output_volume() {
|
|||||||
|
|
||||||
// Mix additively, weighting if in stereo.
|
// Mix additively, weighting if in stereo.
|
||||||
if constexpr (is_stereo) {
|
if constexpr (is_stereo) {
|
||||||
int16_t *const volumes = reinterpret_cast<int16_t *>(&output_volume_);
|
int16_t *const output_volumes = reinterpret_cast<int16_t *>(&output_volume_);
|
||||||
volumes[0] = int16_t((
|
output_volumes[0] = int16_t((
|
||||||
volumes_[volumes[0]] * channel_levels[0] * a_left_ +
|
volumes_[volumes[0]] * channel_levels[0] * a_left_ +
|
||||||
volumes_[volumes[1]] * channel_levels[1] * b_left_ +
|
volumes_[volumes[1]] * channel_levels[1] * b_left_ +
|
||||||
volumes_[volumes[2]] * channel_levels[2] * c_left_
|
volumes_[volumes[2]] * channel_levels[2] * c_left_
|
||||||
) >> 8);
|
) >> 8);
|
||||||
volumes[1] = int16_t((
|
output_volumes[1] = int16_t((
|
||||||
volumes_[volumes[0]] * channel_levels[0] * a_right_ +
|
volumes_[volumes[0]] * channel_levels[0] * a_right_ +
|
||||||
volumes_[volumes[1]] * channel_levels[1] * b_right_ +
|
volumes_[volumes[1]] * channel_levels[1] * b_right_ +
|
||||||
volumes_[volumes[2]] * channel_levels[2] * c_right_
|
volumes_[volumes[2]] * channel_levels[2] * c_right_
|
||||||
|
Loading…
Reference in New Issue
Block a user