fix(audio): a software host keeps a volume set before its audio output exists (AE#660) - #663
Merged
Merged
Conversation
…t exists (AE#660) The engine hands its stored volume to a freshly built host right away, before load() runs. SoftwarePlaybackHost and AudioPlaybackHost only forwarded it to their AudioOutput, which load() builds later, so the write was dropped and every software session started at full volume. The getter also reported 1.0 in that window. Both hosts now hold the volume themselves and hand it to each output they build. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Mf4MXgM9bqugHoe5TW4BYf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #660.
The engine applies its stored volume to a new host right after building it (
applyDesiredVolume), beforeload().SoftwarePlaybackHostandAudioPlaybackHostforwarded that write only to theirAudioOutput, whichload()creates later, so it was lost and every software (dav1d / FFmpeg audio) session started at full volume. The getter also reported1.0in that window, soAetherEngine.volumelied too.Both hosts now keep the volume as their own stored property and apply it to every
AudioOutputthey build. The native hosts were never affected (AVPlayer.volumeexists from construction).Tests:
Issue660SoftwareVolumeTests(both hosts keep a pre-load volume; anAudioPlaybackHostloaded from a WAV fixture plays at it). Red before the fix, green after. Fullswift test: 646 XCTest + 3563 swift-testing, 0 failures.🤖 Generated with Claude Code
https://claude.ai/code/session_01Mf4MXgM9bqugHoe5TW4BYf