mirror of
https://wget.la/https://github.com/Wxw-Gu/WechatExplorer
synced 2026-08-18 12:07:01 +08:00
feat: 语音
This commit is contained in:
@@ -24,6 +24,7 @@ export interface ExportRequest {
|
||||
endTime?: number
|
||||
kinds: ExportMessageKind[]
|
||||
includeMedia: boolean
|
||||
includeVoiceTranscripts?: boolean
|
||||
preferOriginal?: boolean
|
||||
fallbackThumbnail?: boolean
|
||||
keepMissing?: boolean
|
||||
|
||||
@@ -23,6 +23,8 @@ export interface Message {
|
||||
contentData?: ParsedContent
|
||||
voiceDataUrl?: string
|
||||
voiceDuration?: number
|
||||
voiceTranscript?: string
|
||||
voiceTranscriptError?: string
|
||||
localId?: number
|
||||
serverId?: string
|
||||
createTime?: number
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
export const DEFAULT_VOICE_MODEL_ID = 'sensevoice-small-int8'
|
||||
|
||||
export interface VoiceMessageReference {
|
||||
sessionId: string
|
||||
localId: number
|
||||
createTime: number
|
||||
svrId?: string | number
|
||||
}
|
||||
|
||||
export type VoiceModelState =
|
||||
| 'missing'
|
||||
| 'downloading'
|
||||
| 'ready'
|
||||
| 'invalid'
|
||||
| 'error'
|
||||
| 'unsupported'
|
||||
|
||||
export interface VoiceModelStatus {
|
||||
modelId: string
|
||||
version: string
|
||||
state: VoiceModelState
|
||||
downloadedBytes: number
|
||||
totalBytes: number
|
||||
progress: number
|
||||
platform: NodeJS.Platform
|
||||
architecture: string
|
||||
supported: boolean
|
||||
error?: string
|
||||
}
|
||||
|
||||
export interface VoiceModelDownloadResult {
|
||||
success: boolean
|
||||
status: VoiceModelStatus
|
||||
error?: string
|
||||
}
|
||||
|
||||
export type VoiceRecognitionErrorCode =
|
||||
| 'NOT_CONNECTED'
|
||||
| 'MODEL_NOT_READY'
|
||||
| 'VOICE_NOT_FOUND'
|
||||
| 'DECODE_FAILED'
|
||||
| 'EMPTY_AUDIO'
|
||||
| 'CANCELLED'
|
||||
| 'TIMEOUT'
|
||||
| 'WORKER_FAILED'
|
||||
| 'RECOGNITION_FAILED'
|
||||
|
||||
export interface VoiceRecognitionResult {
|
||||
success: boolean
|
||||
transcript?: string
|
||||
language?: string
|
||||
durationMs?: number
|
||||
cached?: boolean
|
||||
error?: string
|
||||
code?: VoiceRecognitionErrorCode
|
||||
}
|
||||
|
||||
export interface VoiceModelProgressEvent extends VoiceModelStatus {}
|
||||
Reference in New Issue
Block a user