QSoundEffect: don't let a silent voice erase the audio mix


QRtAudioEngine zeroes the shared output buffer once per callback and
lets each voice add its contribution. QSoundEffectVoice's muted path
overwrote the frames it was asked for with zeroes instead, erasing
whatever earlier voices had mixed in. Voices are visited in ascending
voice id, which is play() order, so a muted or zero-volume effect
silenced every effect that started before it on the same device.

A silent voice contributes nothing, so return without touching the
buffer. The check stays ahead of the mixing loops, so a silent voice
still does no per-sample work.

testQSoundEffectVoiceMuted asserted the overwrite and is replaced by one
requiring a pre-filled buffer to survive. QAudioEngine's spatial voice
also writes rather than adds, but is the only voice on its own engine.

Fixes: QTBUG-149907
Task-number: QTBUG-133307
Pick-to: 6.11 6.12
Assisted-by: Claude Code
Change-Id: I1bd44424454b416dd8a38d7287957b81610e5bc6
Reviewed-by: Tim Blechmann <tim.blechmann@qt.io>
commit33bc58202be1f772b0a361cb8708ed6829c79232
parentc249578c2307cd369abc8ef588e19fcc62b2bed3
authorJarkko Koivikko <jarkko.koivikko@code-q.fi>
committerJarkko Koivikko <jarkko.koivikko@code-q.fi>
commit timeThu, 3 Sep 2026 13:26:26 +0000