mirror of
https://wget.la/https://github.com/Wxw-Gu/WechatExplorer
synced 2026-12-01 17:25:15 +08:00
feat: 本地 API 支持按需转写语音消息
读取消息时返回本地已有的语音转写及其状态 新增 query/voice-transcribe 接口按 messageRef 转写指定语音
This commit is contained in:
1 parent
e5f0aa59f4
commit
4d9af4a193
11 files changed
+843
-14
No files matched your search
@@ -23,3 +23,30 @@ export function voiceAccountIdentity(accountRoot: string): string {
|
||||
)
|
||||
.digest('hex')
|
||||
}
|
||||
|
||||
/**
|
||||
* 从一条已格式化的消息里取出语音定位信息;不是语音或标识不完整时返回 undefined。
|
||||
* 本地 API 用它判断"这条消息能否转写",与批量转写的口径一致。
|
||||
*/
|
||||
export function voiceMessageReferenceOf(message: {
|
||||
type?: string
|
||||
sessionId?: string
|
||||
localId?: number
|
||||
createTime?: number
|
||||
serverId?: string
|
||||
}): VoiceMessageReference | undefined {
|
||||
if (
|
||||
message.type !== '语音' ||
|
||||
!message.sessionId ||
|
||||
message.localId === undefined ||
|
||||
!message.createTime
|
||||
) {
|
||||
return undefined
|
||||
}
|
||||
return {
|
||||
sessionId: message.sessionId,
|
||||
localId: message.localId,
|
||||
createTime: message.createTime,
|
||||
svrId: message.serverId
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user