feat: 将视频转写重构为纯文字异步语音识别
This commit is contained in:
@@ -556,7 +556,7 @@ export default function AwemeDetailClient({
|
||||
segmentProgress={imageCarouselState.segProgress}
|
||||
musicUrl={isVideo ? undefined : (data as ImageData).music_url}
|
||||
audioRef={audioRef}
|
||||
hasTranscript={isVideo && !!transcript?.speech_detected}
|
||||
hasTranscript={isVideo && !!transcript}
|
||||
onShowTranscript={() => setTranscriptOpen(true)}
|
||||
onTogglePlay={togglePlay}
|
||||
onSeek={handleControlSeek}
|
||||
|
||||
@@ -36,7 +36,7 @@ export function TranscriptPanel({
|
||||
});
|
||||
};
|
||||
|
||||
if (!transcript?.speech_detected || !transcript.transcript?.length) {
|
||||
if (!transcript?.transcript?.length) {
|
||||
return (
|
||||
<div
|
||||
className="fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm"
|
||||
@@ -60,7 +60,7 @@ export function TranscriptPanel({
|
||||
|
||||
{/* 内容 */}
|
||||
<div className="p-8 text-center text-white/60">
|
||||
<p>该视频暂无语音转录内容</p>
|
||||
<p>{transcript ? "未识别到文字" : "该视频尚未转写"}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -80,11 +80,7 @@ export function TranscriptPanel({
|
||||
<div className="flex items-center justify-between p-4 border-b border-white/10 flex-shrink-0">
|
||||
<div>
|
||||
<h2 className="text-lg font-semibold text-white">语音转录</h2>
|
||||
{transcript.language && (
|
||||
<p className="text-xs text-white/50 mt-1">
|
||||
语言: {transcript.language}
|
||||
</p>
|
||||
)}
|
||||
|
||||
</div>
|
||||
<div className="flex items-center gap-2">
|
||||
<button
|
||||
|
||||
@@ -53,8 +53,6 @@ export type ImageData = {
|
||||
export type AwemeData = VideoData | ImageData;
|
||||
|
||||
export type VideoTranscript = {
|
||||
speech_detected: boolean;
|
||||
language: string | null;
|
||||
transcript: string[];
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user