Stopping an inline audio attachment leaves it playing silently (no AudioCommand::StopClip) #352

Open
opened 2026-11-12 20:26:38 +00:00 by charles · 0 comments
Owner

Found in review of PR #316 (Task 16, #266).

fluxer-core chat/media.rs: UserAction::StopAttachment, and starting another attachment, only set the playing clip's gain to 0 (AudioCommand::SetGain { source: PlaybackSource::Clip(tag), gain: 0.0 }). AudioCommand has no way to stop a clip, so the decoded attachment keeps running in the mixer to its end, silently. For a long audio file this holds a mixer voice and CPU until it finishes.

Steps: play an audio attachment (PlayAttachment), then StopAttachment; the clip is still in the mixer until its end.

Fix: add AudioCommand::StopClip(ClipTag) (core port), implement it in fluxer-audio's clip player and apps/fluxer audio_rt.rs, and emit it from chat/media.rs instead of the gain-0 workaround. Cross-crate, so its own serialised task (with or after Text chat 21, which wires attachment playback in the runtime).

Seen on branch textchat-16-core-navigation-read.

Found in review of PR #316 (Task 16, #266). `fluxer-core` `chat/media.rs`: `UserAction::StopAttachment`, and starting another attachment, only set the playing clip's gain to 0 (`AudioCommand::SetGain { source: PlaybackSource::Clip(tag), gain: 0.0 }`). `AudioCommand` has no way to stop a clip, so the decoded attachment keeps running in the mixer to its end, silently. For a long audio file this holds a mixer voice and CPU until it finishes. Steps: play an audio attachment (`PlayAttachment`), then `StopAttachment`; the clip is still in the mixer until its end. Fix: add `AudioCommand::StopClip(ClipTag)` (core port), implement it in `fluxer-audio`'s clip player and `apps/fluxer` `audio_rt.rs`, and emit it from `chat/media.rs` instead of the gain-0 workaround. Cross-crate, so its own serialised task (with or after Text chat 21, which wires attachment playback in the runtime). Seen on branch `textchat-16-core-navigation-read`.
charles added this to the Text chat milestone 2026-11-12 20:26:38 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
charles/fluxer-native#352
No description provided.