mirror of
https://github.com/hicccc77/WeFlow.git
synced 2026-03-25 07:16:51 +00:00
feat(voice-transcribe): 优化语音转写流程并增强数据库缓存机制
- 添加 createTime 参数到语音转写接口,支持更精确的消息定位 - 实现 media.db 列表缓存机制(5分钟TTL),减少重复查询开销 - 添加 media.db 表结构信息缓存,提升数据库操作效率 - 优化语音缓存目录获取逻辑,支持自定义缓存路径配置 - 重构语音数据获取实现,绕过WCDB的buggy getVoiceData方法 - 移除冗余的调试日志,提升代码整洁度 - 删除不再使用的 silk_v3_decoder.exe 文件 - 优化数据库连接流程,后台预热缓存提升响应速度
This commit is contained in:
@@ -1784,7 +1784,16 @@ function MessageBubble({ message, session, showTime, myAvatarUrl, isGroupChat, o
|
||||
throw error
|
||||
}
|
||||
|
||||
const result = await window.electronAPI.chat.getVoiceTranscript(session.username, String(message.localId))
|
||||
const result = await window.electronAPI.chat.getVoiceTranscript(
|
||||
session.username,
|
||||
String(message.localId),
|
||||
message.createTime
|
||||
)
|
||||
console.log('[ChatPage] 调用转写:', {
|
||||
sessionId: session.username,
|
||||
msgId: message.localId,
|
||||
createTime: message.createTime
|
||||
})
|
||||
if (result.success) {
|
||||
const transcriptText = (result.transcript || '').trim()
|
||||
voiceTranscriptCache.set(voiceTranscriptCacheKey, transcriptText)
|
||||
|
||||
Reference in New Issue
Block a user