feat: 语音

This commit is contained in:
电摇小子
2026-08-05 09:45:59 +08:00
committed by Wxw-Gu
parent 69bc6f57e7
commit 7529a67f09
49 changed files with 3013 additions and 154 deletions
@@ -0,0 +1,30 @@
export const VOICE_WORKER_PROTOCOL_VERSION = 1
export interface WorkerRecognitionRequest {
version: typeof VOICE_WORKER_PROTOCOL_VERSION
type: 'recognize'
requestId: string
payload: {
recognizerId: string
samples: Float32Array
sampleRate: number
modelPath: string
tokensPath: string
modelFingerprint: string
}
}
export type WorkerRecognitionResponse =
| {
version: typeof VOICE_WORKER_PROTOCOL_VERSION
type: 'result'
requestId: string
transcript: string
language?: string
}
| {
version: typeof VOICE_WORKER_PROTOCOL_VERSION
type: 'error'
requestId: string
error: string
}