refactor: scope stt module

This commit is contained in:
mARTin-B78 2026-09-04 13:13:10 +02:00
parent c53c47ce2d
commit ababdf6741
5 changed files with 31 additions and 9 deletions

View File

@ -8,6 +8,8 @@ Follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) · versioned wi
## [Unreleased] ## [Unreleased]
### Changed ### Changed
- **STT namespace migration.** STT backend selection, microphone recording, voice loading, and STT-to-TTS helpers now
use a private scope with live compatibility accessors and a `window.TTVC.stt` API.
- **AI-backend namespace migration.** LLM snippets and backend interaction controls now live behind a private section scope - **AI-backend namespace migration.** LLM snippets and backend interaction controls now live behind a private section scope
with an explicit `window.TTVC.aiBackends` API for cross-module snippet initialization. with an explicit `window.TTVC.aiBackends` API for cross-module snippet initialization.
- **Integrations namespace migration.** Endpoint helpers, active-voice listings, virtual design IDs, and API snippet - **Integrations namespace migration.** Endpoint helpers, active-voice listings, virtual design IDs, and API snippet

View File

@ -1 +1 @@
1.24.82 1.24.83

View File

@ -72,6 +72,7 @@ Done incrementally as global-scope ordered files (no ES-module change needed)
- ✅ Combined library production rendering and Reader/Rehearser handoffs use a private scope with an explicit namespace API. - ✅ Combined library production rendering and Reader/Rehearser handoffs use a private scope with an explicit namespace API.
- ✅ Integration endpoint and API-snippet helpers use a private scope with explicit voice/endpoint compatibility exports. - ✅ Integration endpoint and API-snippet helpers use a private scope with explicit voice/endpoint compatibility exports.
- ✅ AI-backend section interactions and snippet initialization use a private scope with an explicit namespace API. - ✅ AI-backend section interactions and snippet initialization use a private scope with an explicit namespace API.
- ✅ STT backend, recording, voice-loading, and STT-to-TTS helpers use a private scope with live compatibility accessors.
- ✅ `static/css/resource-diagnostics.css` — isolated Performance/resource diagnostic panel styles. - ✅ `static/css/resource-diagnostics.css` — isolated Performance/resource diagnostic panel styles.
- ✅ `static/css/background-jobs.css` — isolated background-job history and retry-panel styles. - ✅ `static/css/background-jobs.css` — isolated background-job history and retry-panel styles.
- ✅ `static/css/voice-design.css` — isolated Voice Design form, samples, and preview-match styles. - ✅ `static/css/voice-design.css` — isolated Voice Design form, samples, and preview-match styles.

View File

@ -10,7 +10,7 @@
<meta name="format-detection" content="telephone=no"> <meta name="format-detection" content="telephone=no">
<meta name="color-scheme" content="light dark"> <meta name="color-scheme" content="light dark">
<meta name="theme-color" content="#2563EB"> <meta name="theme-color" content="#2563EB">
<meta name="app-version" content="1.24.82"> <meta name="app-version" content="1.24.83">
<link rel="manifest" href="/manifest.webmanifest"> <link rel="manifest" href="/manifest.webmanifest">
<link rel="icon" href="/static/icon.svg" type="image/svg+xml"> <link rel="icon" href="/static/icon.svg" type="image/svg+xml">
<link rel="apple-touch-icon" href="/static/icon.svg"> <link rel="apple-touch-icon" href="/static/icon.svg">
@ -27,12 +27,12 @@
<!-- ── Core styles (local — no CDN dependency for first paint) ────────── --> <!-- ── Core styles (local — no CDN dependency for first paint) ────────── -->
<link rel="stylesheet" href="/static/vendor/mdi/materialdesignicons.min.css"> <link rel="stylesheet" href="/static/vendor/mdi/materialdesignicons.min.css">
<link rel="stylesheet" href="/static/style.css?v=1.24.82"> <link rel="stylesheet" href="/static/style.css?v=1.24.83">
<link rel="stylesheet" href="/static/css/resource-diagnostics.css?v=1.24.82"> <link rel="stylesheet" href="/static/css/resource-diagnostics.css?v=1.24.83">
<link rel="stylesheet" href="/static/css/background-jobs.css?v=1.24.82"> <link rel="stylesheet" href="/static/css/background-jobs.css?v=1.24.83">
<link rel="stylesheet" href="/static/css/voice-design.css?v=1.24.82"> <link rel="stylesheet" href="/static/css/voice-design.css?v=1.24.83">
<link rel="stylesheet" href="/static/css/rehearser.css?v=1.24.82"> <link rel="stylesheet" href="/static/css/rehearser.css?v=1.24.83">
<link rel="stylesheet" href="/static/css/audiobook.css?v=1.24.82"> <link rel="stylesheet" href="/static/css/audiobook.css?v=1.24.83">
<!-- ── Flag icons — non-blocking (loaded async, icons appear after JS) ── --> <!-- ── Flag icons — non-blocking (loaded async, icons appear after JS) ── -->
@ -397,7 +397,7 @@ window.toggleNavTree = function(treeId, chevronId) {
</script> </script>
<!-- loader.js: fetches sections → loads JS modules → removes skeleton --> <!-- loader.js: fetches sections → loads JS modules → removes skeleton -->
<script src="/static/loader.js?v=1.24.82"></script> <script src="/static/loader.js?v=1.24.83"></script>
</body> </body>
</html> </html>

View File

@ -1,5 +1,7 @@
// ── STT -> TTS ─────────────────────────────────────────────────────────── // ── STT -> TTS ───────────────────────────────────────────────────────────
(function (root) {
let sttTtsSourceId = null; let sttTtsSourceId = null;
let sttTtsOutputBlob = null; let sttTtsOutputBlob = null;
let _sttBackends = []; let _sttBackends = [];
@ -288,3 +290,20 @@ $('stt-tts-save-wav-btn')?.addEventListener('click', () => {
sttTtsDownload(sttTtsOutputBlob, ($('stt-tts-voice-select').value || 'stt_tts') + '_stt_tts.wav'); sttTtsDownload(sttTtsOutputBlob, ($('stt-tts-voice-select').value || 'stt_tts') + '_stt_tts.wav');
}); });
Object.assign(root, {
sttTtsSourceId, sttTtsOutputBlob, _sttBackends, sttTtsRecorder,
sttTtsRecordStream, sttTtsRecordChunks, sttTtsRecordTimer, sttTtsRecordSecs,
sttTtsSelectedSttBackend, sttBackendOptionHtml, updateSttBackendHelp,
refreshSttBackends, sttTtsSelectedBackend, sttTtsDownload, sttTtsUploadFile,
sttTtsFetchVoices, sttTtsSetRecording, sttTtsStopTracks,
});
Object.defineProperty(root, '_sttBackends', { configurable: true, get: () => _sttBackends, set: v => { _sttBackends = v; } });
root.TTVC = root.TTVC || {};
root.TTVC.stt = root.TTVC.stt || {};
Object.assign(root.TTVC.stt, {
get backends() { return _sttBackends; },
refresh: refreshSttBackends,
fetchVoices: sttTtsFetchVoices,
upload: sttTtsUploadFile,
});
})(window);