/
/
/
# What does this implement/fix? When an announcement plays on an AirPlay player that is idle (so it gets its own short-lived stream), Music Assistant turns the speaker up to the announcement volume and then puts it back afterwards. That "put it back" was sent after the stream had already been torn down, so it never reached the speaker — an AirPlay volume command only travels over a running stream. On a speaker that owns its own volume, this left it sitting at the (usually louder) announcement level. It corrected itself the next time you played something, but until then the speaker was too loud. The volume is now handed back at the end of the clip, while the stream is still up. **Related issue (if applicable):** - related issue <link to issue> ## Types of changes - [x] Bugfix (non-breaking change which fixes an issue) — `bugfix` - [ ] New feature (non-breaking change which adds functionality) — `new-feature` - [ ] Enhancement to an existing feature — `enhancement` - [ ] New music/player/metadata/plugin provider — `new-provider` - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) — `breaking-change` - [ ] Refactor (no behaviour change) — `refactor` - [ ] Documentation only — `documentation` - [ ] Maintenance / chore — `maintenance` - [ ] CI / workflow change — `ci` - [ ] Dependencies bump — `dependencies` Changes: - the pre-announcement volume is restored at the clip's audible end instead of after the announcement session is stopped - a failed or cancelled announcement restores it too, still before the session is torn down - the total announcement length is unchanged ## Checklist - [x] The code change is tested and works locally. - [x] `pre-commit run --all-files` passes. - [x] `pytest` passes, and tests have been added/updated under `tests/` where applicable. - [ ] For changes to shared models, the companion PR in `music-assistant/models` is linked. - [ ] For changes affecting the UI, the companion PR in `music-assistant/frontend` is linked. - [x] I have read and complied with the project's [AI Policy](https://github.com/music-assistant/.github/blob/main/AI_POLICY.md) for any AI-assisted contributions. - [ ] I have [raised a PR against the documentation repository](https://github.com/music-assistant/music-assistant.io/blob/main/CONTRIBUTING.md) targeting the main or beta branch as appropriate.