Spaces:
Running
Running
cfahlgren1 HF Staff
convert talking pixel to a sveltekit app that runs pivo-1.4m tts in the browser
3ec6b9e Download src/lib/protocol.ts from cfahlgren1/talking-pixel: direct link, hf CLI and curl.
- Browser
- Download file 1.07 kB
-
https://huggingface.co/spaces/cfahlgren1/talking-pixel/resolve/main/src/lib/protocol.ts
- Command line
-
hf download hf://spaces/cfahlgren1/talking-pixel/src/lib/protocol.ts
-
curl -L -o protocol.ts https://huggingface.co/spaces/cfahlgren1/talking-pixel/resolve/main/src/lib/protocol.ts
1.07 kB
| // Messages between the page and the synthesis worker. | |
| import type { Voice } from './frontend.ts'; | |
| import type { WordTiming } from './engine.ts'; | |
| export type WorkerRequest = | |
| | { type: 'init'; baseUrl: string } | |
| | { type: 'cancel'; id: number } | |
| | { type: 'speak'; id: number; text: string; voice: Voice }; | |
| export type WorkerMessage = | |
| | { type: 'progress'; loaded: number; total: number } | |
| | { type: 'ready'; backend: string; fromCache: boolean; networkBytes: number; totalBytes: number; loadMs: number; initMs: number; words: number } | |
| | { type: 'fatal'; message: string } | |
| | { | |
| type: 'plan'; id: number; frames: number; normalized: string; words: WordTiming[]; symbols: string[]; | |
| tokenStart: Int32Array; durations: Int32Array; unknown: string[]; sampleRate: number; hop: number; | |
| } | |
| | { type: 'audio'; id: number; pcm: Float32Array; firstFrame: number } | |
| | { type: 'done'; id: number; seconds: number; computeMs: number; firstChunkMs: number | null } | |
| | { type: 'error'; id: number; message: string; user: boolean; characters?: string[] }; | |