Use single-thread ONNX runtime for mobile speech
Build and publish frontend / publish (push) Successful in 50s

This commit is contained in:
Ein Anderssono
2026-10-16 08:51:08 +02:00
parent aa832fd7cc
commit a4f89f2b82
9 changed files with 60 additions and 2 deletions
+3 -1
View File
@@ -1,7 +1,8 @@
import {TtsSession} from '@mintplex-labs/piper-tts-web';
import * as onnxRuntime from 'onnxruntime-web';
import {trackDownloadProgress} from './piper-download-progress.mjs';
import {localPiperModelUrl} from './piper-model-routing.mjs';
import {createOnnxWasmPaths} from './piper-onnx-config.mjs';
import {configureOnnxRuntime, createOnnxWasmPaths} from './piper-onnx-config.mjs';
const VOICE_ID = 'sv_SE-nst-medium';
const ASSET_ROOT = '/static/piper-wasm-v1';
@@ -50,6 +51,7 @@ let activeRequestId = null;
async function getSession() {
if (!sessionPromise) {
configureOnnxRuntime(onnxRuntime);
sessionPromise = TtsSession.create({
voiceId: VOICE_ID,
wasmPaths: {