Serve Piper speech assets from dedicated static service
Build and publish frontend / publish (push) Successful in 49s
Build and publish frontend / publish (push) Successful in 49s
This commit is contained in:
+3
-3
@@ -3,11 +3,11 @@ import {localPiperModelUrl} from './piper-model-routing.mjs';
|
||||
import {createOnnxWasmPaths} from './piper-onnx-config.mjs';
|
||||
|
||||
const VOICE_ID = 'sv_SE-nst-medium';
|
||||
const ASSET_ROOT = '/tts/piper-wasm-v1';
|
||||
const ASSET_ROOT = '/static/piper-wasm-v1';
|
||||
const localFetch = self.fetch.bind(self);
|
||||
|
||||
// The pinned TTS library uses a fixed Hugging Face URL. Keep its OPFS cache logic,
|
||||
// but serve every model/config request from this frontend origin instead.
|
||||
// Keep the TTS library's OPFS cache logic, but serve models/config from the
|
||||
// same-origin static asset service instead of its built-in external model URL.
|
||||
self.fetch = (resource, options) => {
|
||||
const requestedUrl = resource instanceof Request ? resource.url : String(resource);
|
||||
const localModelUrl = localPiperModelUrl(requestedUrl, self.location.origin);
|
||||
|
||||
Reference in New Issue
Block a user