[PR #8167] [MERGED] feat(audio): add dedicated music and sound effect connections #8137

Closed
opened 2026-10-24 04:10:41 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/8167
Author: @SpicyMarinara
Created: 10/23/2026
Status: ✅ Merged
Merged: 10/23/2026
Merged by: @SpicyMarinara

Base: staging ← Head: feat/generative-audio-connections


📝 Commits (10+)

  • 4651a03 chore: reserve dedicated generative audio implementation
  • 12aded4 Merge branch 'feat/chat-agent-lorebook-attachments' into feat/generative-audio-connections
  • a2ce040 feat(audio): expose isolated package playback service
  • be27059 fix(tts): forward explicit connection for speech sequences
  • fb31525 feat(audio): add bounded provider generation adapters
  • f03661e feat(audio): separate generation connections and preserve legacy Game audio
  • d2bd1bf fix(audio): preserve legacy models and avoid migration work per cue
  • daeaae5 feat: configure dedicated music and sound-effect connections
  • 9de682b Merge remote-tracking branch 'origin/staging' into feat/generative-audio-connections
  • ef3f2fd Merge commit '8d3078cc5' into feat/generative-audio-connections

📊 Changes

60 files changed (+4746 additions, -617 deletions)

View changed files

📝 docs/connections/providers-reference.md (+23 -5)
📝 docs/development/optional-agent-packages.md (+39 -0)
📝 docs/game/game-assets.md (+9 -9)
📝 docs/media/tts-setup.md (+12 -4)
📝 e2e/compatible-game-audio.e2e.ts (+246 -17)
📝 e2e/marinara-host-namespace.e2e.ts (+50 -3)
📝 packages/client/src/components/chat/ChatSettingsDrawer.tsx (+5 -1)
📝 packages/client/src/components/chat/RoleplayCommandsSettings.tsx (+17 -2)
📝 packages/client/src/components/connections/ConnectionEditor.tsx (+379 -127)
📝 packages/client/src/components/game/GameCombatUI.tsx (+1 -0)
📝 packages/client/src/components/game/GameNarration.tsx (+2 -0)
📝 packages/client/src/components/game/GameSetupWizard.tsx (+27 -10)
📝 packages/client/src/components/game/GameSurface.tsx (+9 -23)
📝 packages/client/src/components/panels/ConnectionsPanel.tsx (+56 -11)
📝 packages/client/src/components/panels/settings/TTSConfigCard.tsx (+5 -26)
📝 packages/client/src/hooks/use-connections.ts (+4 -0)
➕ packages/client/src/lib/audio-service.ts (+48 -0)
📝 packages/client/src/lib/connection-filters.ts (+19 -1)
📝 packages/client/src/lib/connection-transfer.ts (+50 -10)
📝 packages/client/src/lib/game-audio.ts (+98 -27)

...and 40 more files

📄 Description

Why this change

Game music and sound effects currently share speech settings. This adds independent generation connections for Game, opt-in Roleplay sound commands and downloadable agents while preserving character voices, saved Game connection IDs and existing audio assets.

Closes #8166. Gacha Forge companion: Pasta-Devs/Marinara-Agents#1610. Translated documentation: #8168.

Integration: Exact candidate d1c566b399 cleanly includes actual staging b2a126f952, which merged #8153 and contributor #8007. API 1.381 is preserved. Current-head required checks, completed substantive Dottore examination and resolved findings remain merge gates. This PR stays ready; follow-up changes use automatic incremental review.

Verified staging delivery: #8167 merged normally with locked reviewed head d1c566b3 as actual Engine3a7081f3. Current staginge91d3ad8 preserves all60 audio feature files and adds the separately reviewed Memory Recall fix. Its Regression, CodeQL and container workflows all completed successfully; fresh GHCR metadata verifies e91d3ad8 for both amd64 and arm64 (index sha256:9602d2086f3e7be057a973522be36a9515ded0867fad8593c2e006e70395206f). This is registry/source verification, not a Docker pull or paid-provider test. Gacha #1610 was externally merged before its final alias/pin repair reached that branch; the remaining patch is tracked in Pasta-Devs/Marinara-Agents#1625 and #1626 as version1.11.1. English-guide translation #8173 is separately published on docs-i18n.

What changed

  • Add Music & Sound Effects Connections for ElevenLabs, SunoAPI and custom binary/Chat Completions endpoints, with separate music/SFX models, switches, defaults and fallback. Speech remains in Text to Speech.
  • Migrate legacy generation configurations into dedicated connections without changing speech or voice settings. Preserve independent legacy settings, explicit Game IDs through host aliases, legacy caches and user asset overrides. Deleting a migrated connection does not recreate it on restart.
  • Share validated, cached generation across Game, Roleplay and package audio. Concurrent requests share jobs; polling/downloads are bounded, downloaded audio is validated and provider result requests do not receive connection credentials.
  • Preserve import quarantine, provider credential isolation and explicit category-default control. Imported data cannot forge migration aliases. Re-export a legacy blank source as an importable default; continue refusing unknown nonempty sources.
  • Expose API1.381 with disposable players, the existing asset manifest and stock music selection. Pass the chosen speech connection through sequence playback and wait for voice completion. A refused AudioContext constructor follows the existing fallback and remains retryable.
  • Wire generation selectors into Game setup/playback and Roleplay, including legacy IDs and unavailable selections. The Gacha package supplies its own TTS, mute, mixer and autoplay controls.
  • Show the existing localized callback error before saving known unsafe Suno callback destinations, including stale callbacks with music off. The server remains authoritative for DNS and outbound policy.
  • Keep successfully committed connection creates/edits successful when an optional migration fails; log the retryable failure. Diagnose unreadable legacy settings once per database boot without logging their content, and preserve their opportunity to migrate after repair.
  • Keep speech cache entries separate by connection/voice/speaker/tone, including aliases and clear operations; include connection IDs in native chat/Game cache signatures.
  • Reset endpoint/music/SFX defaults when switching Custom to a preset; preserve same-source settings and clear credentials on service changes.
  • Preserve credentials/defaults/legacy aliases when a profile uses the equivalent nullish ElevenLabs generation source; retain quarantine for blank, padded, unknown or changed sources/endpoints.
  • Return unconfigured audio readiness when optional no-row migration fails, warning once per database; explicit required legacy bridge failures still propagate.
  • Preserve the existing key-only speech-cache clear API. Clear only requested original-key families across memory, in-flight work and persistent blobs/metadata, including legacy keys; prevent late and early lookup races from restoring cleared audio.
  • Update four English guides. No application release bump or changelog change.

SunoAPI's Generate Music contract documents an optional title. Music requires a public HTTPS callback; SFX creation does not. Shared task-status lookup for Suno SFX is a bounded compatibility inference, not paid live-provider proof.

Validation and review

Cache repair, actual review disposition and verified staging delivery.

For exact final source d1c566b399:

  • Full pnpm check passes: TypeScript, ESLint, localization, formatting, E2E types and production build. One inherited Professor hook warning remains.
  • Local CodeRabbit completed with zero findings on all three follow-up files.
  • Five affected Node files pass on the identical frozen source bytes. The maintained actual service/cache regression proves key-only clearing, source/voice separation, alias reuse, unrelated work and early/late race controls.
  • Nine actual headless Chromium IndexedDB controls pass against the exact cache source, including persisted source variants, aliases, metadata and legacy keys. Prior-production and family-matching-only negative controls fail the intended assertion.
  • Seven unchanged full-server source shell smokes and three fresh compiled startup/reload projects pass on this commit.
  • Current d1c566b3 hosted Regression40015103408 passes 1074/1074 unique Node files across three shards at an actual checkout with the same tree. All 10 platform jobs in40015103512 pass. Actual current-head incremental Dottore40015116451 completed successfully and reported one LOW plus one nit. The LOW assumes an upgrade from an unmerged intermediate PR spelling: independently verified staging/main/release2.5.1 source objects never emitted it. The source-backed non-regression disposition is posted and the thread resolved. The local parameter-rebinding nit is stylistic. This remains a reported finding with a documented disposition, not a zero-finding review.

The public clear API issue was found after the prior candidate passed its checks; it was held before merge and repaired here. Only three files change from fffb8dca. Nine other files from the prior eleven-file repair remain byte-identical; only its service and maintained identity test overlap this follow-up.

Prior exact candidate fffb8dca completed actual incremental Dottore40012354089 with zero defects/notes, all8 required checks, and 1074/1074 unique hosted Node files. Its actual synthetic checkout has the same tree. Those are earlier-head results; new-head hosted gates remain required. The PR stays ready and uses ordinary automatic incremental review from that completed checkpoint, with no draft/full-review cycle or status override.

The earlier eleven-file integration packet records full check,15 affected Node files plus the literal prompt trio,7 shell smokes,3 compiled projects and six actual Custom-to-preset CRUD cases across dark/light desktop Chromium/mobile Chromium/mobile WebKit. The editor/E2E bytes remain unchanged; its older4abb backend boundary is explicit. Four actual4abb findings were reproduced and fixed. Two source-backed false-positive dispositions preserve unknown-service refusal and the hidden retry-anchor counterexample.

Earlier4abb proof and the merged8153 dependency proof remain separately attributed, including the dependency's explicit unverified-findings qualification. Initial environment/calibration failures are retained. No product assertion or timeout was weakened.

Manual verification still required

  • Manually verify real ElevenLabs, SunoAPI and custom-provider accounts with chosen models and credentials.
  • Manually verify sound output, gesture permission and mute/mixer behavior on physical phones and desktop browsers.
  • Manually verify Game/Roleplay connection selection and unavailable saved connections.
  • Manually verify the Connections UI in both themes and mobile landscape.
  • After the host merges and the companion artifact is rebuilt, update the installed Gacha package and verify assigned character voices, mute, sliders and autoplay.
  • Publish the matching translated guides and verify their raw bytes and manifests.
  • Build and run a container for this change.
  • Complete the contributor checklist in CONTRIBUTING.md.

Browser emulation and local MP3 endpoints do not establish physical-device audio or paid-provider compatibility. Gacha Forge must pin the actual Engine merge and rebuild its ZIP/catalog before delivery. Updating Engine alone does not update an installed agent package. Connection galleries and the callback proof cover inspected dark/light desktop/mobile captures.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/8167 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 10/23/2026 **Status:** ✅ Merged **Merged:** 10/23/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `feat/generative-audio-connections` --- ### 📝 Commits (10+) - [`4651a03`](https://github.com/Pasta-Devs/Marinara-Engine/commit/4651a036557ba7f7cbec2ece1403a0db11263e63) chore: reserve dedicated generative audio implementation - [`12aded4`](https://github.com/Pasta-Devs/Marinara-Engine/commit/12aded4d3b0b5b994030bff22a45b35a3baed99c) Merge branch 'feat/chat-agent-lorebook-attachments' into feat/generative-audio-connections - [`a2ce040`](https://github.com/Pasta-Devs/Marinara-Engine/commit/a2ce040d03d6e697c01785ca244c64c3e8bf40f4) feat(audio): expose isolated package playback service - [`be27059`](https://github.com/Pasta-Devs/Marinara-Engine/commit/be2705992efd4d78cf57fb7be8ee1991eb0d32d6) fix(tts): forward explicit connection for speech sequences - [`fb31525`](https://github.com/Pasta-Devs/Marinara-Engine/commit/fb3152508fa49d798c4a481e1917417f4a2e6d4d) feat(audio): add bounded provider generation adapters - [`f03661e`](https://github.com/Pasta-Devs/Marinara-Engine/commit/f03661e94690efcb979575fb7cde50a1521475f9) feat(audio): separate generation connections and preserve legacy Game audio - [`d2bd1bf`](https://github.com/Pasta-Devs/Marinara-Engine/commit/d2bd1bfc2de023fef0997732460a264d2f4212d3) fix(audio): preserve legacy models and avoid migration work per cue - [`daeaae5`](https://github.com/Pasta-Devs/Marinara-Engine/commit/daeaae573b1506b64cbc5cec9df7359d2188a6f2) feat: configure dedicated music and sound-effect connections - [`9de682b`](https://github.com/Pasta-Devs/Marinara-Engine/commit/9de682b1ba5ea4bac5ec96dcd7f9bec6be0ba89b) Merge remote-tracking branch 'origin/staging' into feat/generative-audio-connections - [`ef3f2fd`](https://github.com/Pasta-Devs/Marinara-Engine/commit/ef3f2fd9dd99992c607b021dfe6000dc7fa44967) Merge commit '8d3078cc5' into feat/generative-audio-connections ### 📊 Changes **60 files changed** (+4746 additions, -617 deletions) <details> <summary>View changed files</summary> 📝 `docs/connections/providers-reference.md` (+23 -5) 📝 `docs/development/optional-agent-packages.md` (+39 -0) 📝 `docs/game/game-assets.md` (+9 -9) 📝 `docs/media/tts-setup.md` (+12 -4) 📝 `e2e/compatible-game-audio.e2e.ts` (+246 -17) 📝 `e2e/marinara-host-namespace.e2e.ts` (+50 -3) 📝 `packages/client/src/components/chat/ChatSettingsDrawer.tsx` (+5 -1) 📝 `packages/client/src/components/chat/RoleplayCommandsSettings.tsx` (+17 -2) 📝 `packages/client/src/components/connections/ConnectionEditor.tsx` (+379 -127) 📝 `packages/client/src/components/game/GameCombatUI.tsx` (+1 -0) 📝 `packages/client/src/components/game/GameNarration.tsx` (+2 -0) 📝 `packages/client/src/components/game/GameSetupWizard.tsx` (+27 -10) 📝 `packages/client/src/components/game/GameSurface.tsx` (+9 -23) 📝 `packages/client/src/components/panels/ConnectionsPanel.tsx` (+56 -11) 📝 `packages/client/src/components/panels/settings/TTSConfigCard.tsx` (+5 -26) 📝 `packages/client/src/hooks/use-connections.ts` (+4 -0) ➕ `packages/client/src/lib/audio-service.ts` (+48 -0) 📝 `packages/client/src/lib/connection-filters.ts` (+19 -1) 📝 `packages/client/src/lib/connection-transfer.ts` (+50 -10) 📝 `packages/client/src/lib/game-audio.ts` (+98 -27) _...and 40 more files_ </details> ### 📄 Description ## Why this change Game music and sound effects currently share speech settings. This adds independent generation connections for Game, opt-in Roleplay sound commands and downloadable agents while preserving character voices, saved Game connection IDs and existing audio assets. Closes #8166. Gacha Forge companion: Pasta-Devs/Marinara-Agents#1610. Translated documentation: #8168. **Integration:** Exact candidate d1c566b3995419b11c38cf05ac017e67d086840a cleanly includes actual staging b2a126f952272ed6c5be51ee8b6fef7babdcbfc1, which merged #8153 and contributor #8007. API **1.381** is preserved. Current-head required checks, completed substantive Dottore examination and resolved findings remain merge gates. This PR stays ready; follow-up changes use automatic incremental review. **Verified staging delivery:** #8167 merged normally with locked reviewed head d1c566b3 as actual Engine3a7081f3. Current staginge91d3ad8 preserves all60 audio feature files and adds the separately reviewed Memory Recall fix. Its Regression, CodeQL and container workflows all completed successfully; fresh GHCR metadata verifies e91d3ad8 for both amd64 and arm64 (index `sha256:9602d2086f3e7be057a973522be36a9515ded0867fad8593c2e006e70395206f`). This is registry/source verification, not a Docker pull or paid-provider test. Gacha #1610 was externally merged before its final alias/pin repair reached that branch; the remaining patch is tracked in Pasta-Devs/Marinara-Agents#1625 and #1626 as version1.11.1. English-guide translation #8173 is separately published on docs-i18n. ## What changed - Add **Music & Sound Effects** Connections for ElevenLabs, SunoAPI and custom binary/Chat Completions endpoints, with separate music/SFX models, switches, defaults and fallback. Speech remains in **Text to Speech**. - Migrate legacy generation configurations into dedicated connections without changing speech or voice settings. Preserve independent legacy settings, explicit Game IDs through host aliases, legacy caches and user asset overrides. Deleting a migrated connection does not recreate it on restart. - Share validated, cached generation across Game, Roleplay and package audio. Concurrent requests share jobs; polling/downloads are bounded, downloaded audio is validated and provider result requests do not receive connection credentials. - Preserve import quarantine, provider credential isolation and explicit category-default control. Imported data cannot forge migration aliases. Re-export a legacy blank source as an importable default; continue refusing unknown nonempty sources. - Expose API1.381 with disposable players, the existing asset manifest and stock music selection. Pass the chosen speech connection through sequence playback and wait for voice completion. A refused AudioContext constructor follows the existing fallback and remains retryable. - Wire generation selectors into Game setup/playback and Roleplay, including legacy IDs and unavailable selections. The Gacha package supplies its own TTS, mute, mixer and autoplay controls. - Show the existing localized callback error before saving known unsafe Suno callback destinations, including stale callbacks with music off. The server remains authoritative for DNS and outbound policy. - Keep successfully committed connection creates/edits successful when an optional migration fails; log the retryable failure. Diagnose unreadable legacy settings once per database boot without logging their content, and preserve their opportunity to migrate after repair. - Keep speech cache entries separate by connection/voice/speaker/tone, including aliases and clear operations; include connection IDs in native chat/Game cache signatures. - Reset endpoint/music/SFX defaults when switching Custom to a preset; preserve same-source settings and clear credentials on service changes. - Preserve credentials/defaults/legacy aliases when a profile uses the equivalent nullish ElevenLabs generation source; retain quarantine for blank, padded, unknown or changed sources/endpoints. - Return unconfigured audio readiness when optional no-row migration fails, warning once per database; explicit required legacy bridge failures still propagate. - Preserve the existing key-only speech-cache clear API. Clear only requested original-key families across memory, in-flight work and persistent blobs/metadata, including legacy keys; prevent late and early lookup races from restoring cleared audio. - Update four English guides. No application release bump or changelog change. SunoAPI's [Generate Music contract](https://docs.sunoapi.org/suno-api/generate-music) documents an optional title. Music requires a public HTTPS callback; SFX creation does not. Shared task-status lookup for Suno SFX is a bounded compatibility inference, not paid live-provider proof. ## Validation and review [Cache repair, actual review disposition and verified staging delivery](https://gist.github.com/SpicyMarinara/da31106f984a39f7850c8d5605dec5e1). For exact final source d1c566b3995419b11c38cf05ac017e67d086840a: - Full pnpm check passes: TypeScript, ESLint, localization, formatting, E2E types and production build. One inherited Professor hook warning remains. - Local CodeRabbit completed with **zero findings on all three follow-up files**. - Five affected Node files pass on the identical frozen source bytes. The maintained actual service/cache regression proves key-only clearing, source/voice separation, alias reuse, unrelated work and early/late race controls. - **Nine actual headless Chromium IndexedDB controls** pass against the exact cache source, including persisted source variants, aliases, metadata and legacy keys. Prior-production and family-matching-only negative controls fail the intended assertion. - **Seven unchanged full-server source shell smokes** and **three fresh compiled startup/reload projects** pass on this commit. - Current d1c566b3 hosted Regression40015103408 passes **1074/1074 unique Node files** across three shards at an actual checkout with the same tree. All **10 platform jobs** in40015103512 pass. Actual current-head incremental Dottore40015116451 completed successfully and reported one LOW plus one nit. The LOW assumes an upgrade from an unmerged intermediate PR spelling: independently verified staging/main/release2.5.1 source objects never emitted it. [The source-backed non-regression disposition](https://github.com/Pasta-Devs/Marinara-Engine/pull/8167#discussion_r4363868166) is posted and the thread resolved. The local parameter-rebinding nit is stylistic. This remains a reported finding with a documented disposition, not a zero-finding review. The public clear API issue was found after the prior candidate passed its checks; it was held before merge and repaired here. Only three files change from fffb8dca. Nine other files from the prior eleven-file repair remain byte-identical; only its service and maintained identity test overlap this follow-up. **Prior exact candidate fffb8dca** completed actual incremental Dottore40012354089 with **zero defects/notes**, all8 required checks, and **1074/1074 unique hosted Node files**. Its actual synthetic checkout has the same tree. Those are earlier-head results; new-head hosted gates remain required. The PR stays ready and uses ordinary automatic incremental review from that completed checkpoint, with no draft/full-review cycle or status override. [The earlier eleven-file integration packet](https://gist.github.com/SpicyMarinara/f80dedc18e68d46d40f9d84c8b47147e) records full check,15 affected Node files plus the literal prompt trio,7 shell smokes,3 compiled projects and six actual Custom-to-preset CRUD cases across dark/light desktop Chromium/mobile Chromium/mobile WebKit. The editor/E2E bytes remain unchanged; its older4abb backend boundary is explicit. Four actual4abb findings were reproduced and fixed. [Two source-backed false-positive dispositions](https://gist.github.com/SpicyMarinara/8dac27969ac1889fb727a71909213114) preserve unknown-service refusal and the hidden retry-anchor counterexample. [Earlier4abb proof](https://gist.github.com/SpicyMarinara/5b0e744b77cdc4959e4ca07173142e66) and [the merged8153 dependency proof](https://gist.github.com/SpicyMarinara/60d6711a6da5fc6810193132c2b41a45) remain separately attributed, including the dependency's explicit unverified-findings qualification. Initial environment/calibration failures are retained. No product assertion or timeout was weakened. ## Manual verification still required - [ ] Manually verify real ElevenLabs, SunoAPI and custom-provider accounts with chosen models and credentials. - [ ] Manually verify sound output, gesture permission and mute/mixer behavior on physical phones and desktop browsers. - [ ] Manually verify Game/Roleplay connection selection and unavailable saved connections. - [ ] Manually verify the Connections UI in both themes and mobile landscape. - [ ] After the host merges and the companion artifact is rebuilt, update the installed Gacha package and verify assigned character voices, mute, sliders and autoplay. - [ ] Publish the matching translated guides and verify their raw bytes and manifests. - [ ] Build and run a container for this change. - [ ] Complete the contributor checklist in CONTRIBUTING.md. Browser emulation and local MP3 endpoints do not establish physical-device audio or paid-provider compatibility. Gacha Forge must pin the **actual Engine merge** and rebuild its ZIP/catalog before delivery. Updating Engine alone does not update an installed agent package. [Connection galleries](https://gist.github.com/SpicyMarinara/cc681e86ec273d9a2f02cf322dbed3c4) and the callback proof cover inspected dark/light desktop/mobile captures. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi changed title from [PR #8167] feat(audio): add dedicated music and sound effect connections to [PR #8167] [MERGED] feat(audio): add dedicated music and sound effect connections 2026-10-25 04:04:20 +07: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
Pasta-Devs/Marinara-Engine#8137
No description provided.