fix(voice): clarify recording disposition
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import type { FeedbackSession, VoiceAudioSegment } from '../../utils/types'
|
||||
import type { FeedbackSession, VoiceAudioSegment, VoiceLesson } from '../../utils/types'
|
||||
|
||||
export type VoicePrimaryAction = 'save' | 'retry' | 'processing' | 'generate'
|
||||
|
||||
@@ -25,6 +25,15 @@ export function getFailedVoiceSegments(session: FeedbackSession): VoiceAudioSegm
|
||||
)
|
||||
}
|
||||
|
||||
export function getVoiceLessonStatusText(lesson: VoiceLesson): string {
|
||||
if (lesson.status === 'failed') return '转录失败'
|
||||
if (lesson.status === 'recording') return '录音中'
|
||||
if (lesson.status === 'processing') return '处理中'
|
||||
if (lesson.appliedDirectly) return '已加入输入框'
|
||||
if (lesson.includedInGeneration) return '已生成反馈'
|
||||
return '待生成反馈'
|
||||
}
|
||||
|
||||
export function getVoiceFailureHint(session: FeedbackSession): string {
|
||||
const failedSegments = getFailedVoiceSegments(session)
|
||||
const hasNoClearSpeech = failedSegments.some((segment) => {
|
||||
@@ -33,7 +42,7 @@ export function getVoiceFailureHint(session: FeedbackSession): string {
|
||||
})
|
||||
const count = session.failedSegmentCount
|
||||
if (hasNoClearSpeech) {
|
||||
return `${count}段录音未识别到清晰语音,可能是录音过短、静音或环境噪声较大。可重试,或放弃后重新录制。`
|
||||
return `${count}段录音未识别到清晰语音,可能是录音过短、静音或环境噪声较大。可重试,或放弃该失败录音。`
|
||||
}
|
||||
return `${count}段录音转录失败,可重试,或放弃后重新录制。`
|
||||
return `${count}段录音转录失败,可重试,或放弃该失败录音。`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user