Skip to content

fix(audio): keep paused playback alive - #2018

Merged
joeykchen merged 1 commit into
goplus:devfrom
joeykchen:fix/paused-audio-lifetime
Sep 28, 2026
Merged

joeykchen merged 1 commit into
goplus:devfrom
joeykchen:fix/paused-audio-lifetime

Conversation

@joeykchen

Copy link
Copy Markdown
Contributor

Godot reports an active paused stream as not playing. Forwarding that value made the Go audio manager discard its playback ID before Resume, and allowed its wait/cleanup paths to treat the sound as finished. Make the engine query include the existing paused state, consistent with the backend's voice-retention rule, and document that lifetime contract on the Go Backend interface.

The second cleanup review keeps this to one backend expression and one contract comment. No Go paused-state mirror or additional helper is introduced. This engine-side fix requires a runtime built with the updated SPX module.

Validation:

  • A real Godot C++ regression fails on the old backend only at the paused-lifetime assertions; after rebuilding the patched module, all 44 assertions pass without resource-leak diagnostics.
  • Covers pause, update, resume, Stop, StopAll, stopped-player cleanup and audio-object destruction using real stream playback.
  • Relevant Go audio/root tests, pure-engine checks and root wasm compilation pass.
  • Runtime metadata is regenerated twice with identical output; the source-position metadata change is included.

@fennoai fennoai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the complete fixed range from 03576e6c0bbead9e73736482539dd321f5521206 through 546aeea343b36ee404f7fd87a9e772cf171fe9f9, including the Godot audio lifetime change, backend contract documentation, generated metadata, and regression coverage. The paused-state query is consistent with the existing cleanup logic, and the focused validation passed with go test ./internal/audio and git diff --check; no concrete, actionable findings remain.

@joeykchen
joeykchen force-pushed the fix/paused-audio-lifetime branch from 546aeea to 0a18441 Compare September 28, 2026 04:31
@joeykchen
joeykchen merged commit 96332f3 into goplus:dev Sep 28, 2026
9 checks passed
@joeykchen
joeykchen deleted the fix/paused-audio-lifetime branch September 28, 2026 04:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants