Fix: handle echogarden align error (#620)

* may re-generate when "no matching voice found"

* may regenerate if the original text has not-matching voice

* specify language to avoid "no matching voice found"
This commit is contained in:
an-lee
2024-05-20 10:30:28 +08:00
committed by GitHub
parent e0b2f59a23
commit cdbaf89005
10 changed files with 997 additions and 464 deletions

View File

@@ -34,7 +34,7 @@ export const MediaLoadingModal = () => {
return (
<AlertDialog open={!decoded || !Boolean(transcription?.result?.timeline)}>
<AlertDialogOverlay className="z-[100]" />
<AlertDialogOverlay className="" />
<AlertDialogContent className="z-[100]">
<AlertDialogHeader>
<AlertDialogTitle>{t("preparingAudio")}</AlertDialogTitle>
@@ -55,9 +55,7 @@ export const MediaLoadingModal = () => {
<XCircleIcon className="w-4 h-4 text-destructive" />
</div>
<div className="select-text">
<div className="mb-2">
{decodeError}
</div>
<div className="mb-2">{decodeError}</div>
<div className="text-sm text-muted-foreground">
{t("failedToDecodeWaveform")}:{" "}
<span className="break-all ">{media?.src}</span>
@@ -97,12 +95,17 @@ export const MediaLoadingModal = () => {
<div className="inline">
<span>{t("notTranscribedYet")}</span>
{decoded && (
<Button
onClick={generateTranscription}
className="ml-4"
size="sm"
>
{t("transcribe")}
<Button asChild className="ml-4" size="sm">
<a
className="cursor-pointer"
onClick={() =>
generateTranscription({
originalText: "",
})
}
>
{t("regenerate")}
</a>
</Button>
)}
</div>

View File

@@ -57,7 +57,7 @@ export const TranscriptionForm = (props: {
const handleSave = async () => {
setSubmiting(true);
try {
await generateTranscription(content);
await generateTranscription({ originalText: content });
setOpen(false);
} catch (e) {
toast.error(e.message);

View File

@@ -144,7 +144,13 @@ export const MediaTranscription = () => {
</AlertDialogHeader>
<AlertDialogFooter>
<AlertDialogCancel>{t("cancel")}</AlertDialogCancel>
<AlertDialogAction onClick={() => generateTranscription("")}>
<AlertDialogAction
onClick={() =>
generateTranscription({
originalText: "",
})
}
>
{t("transcribe")}
</AlertDialogAction>
</AlertDialogFooter>

View File

@@ -284,7 +284,11 @@ export const AssistantMessageComponent = (props: {
</DropdownMenu>
</div>
<Sheet open={shadowing} onOpenChange={(value) => setShadowing(value)}>
<Sheet
modal={false}
open={shadowing}
onOpenChange={(value) => setShadowing(value)}
>
<SheetContent
side="bottom"
className="h-screen p-0"