mirror of
https://wget.la/https://github.com/Wxw-Gu/WechatExplorer
synced 2026-08-18 20:19:09 +08:00
feat: 语音
This commit is contained in:
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user