mirror of
https://wget.la/https://github.com/Wxw-Gu/WechatExplorer
synced 2026-08-18 20:19:09 +08:00
31 lines
674 B
TypeScript
31 lines
674 B
TypeScript
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
|
|
}
|