Force alignment for tts audio (#418)
* add originalText as param * save original text when added from tts speech * fix player in conversation sheet * minor fix
This commit is contained in:
@@ -26,6 +26,10 @@ export const AudioPlayer = (props: { id?: string; md5?: string }) => {
|
||||
|
||||
useEffect(() => {
|
||||
setRef(ref);
|
||||
|
||||
return () => {
|
||||
setRef(null);
|
||||
};
|
||||
}, [ref]);
|
||||
|
||||
return (
|
||||
|
||||
@@ -72,6 +72,7 @@ export const MediaCurrentRecording = (props: { height?: number }) => {
|
||||
|
||||
const removeComparingPitchContour = () => {
|
||||
if (!wavesurfer) return;
|
||||
if (!regions) return;
|
||||
|
||||
regions
|
||||
.getRegions()
|
||||
|
||||
@@ -72,7 +72,7 @@ export const MediaTranscription = () => {
|
||||
} as ScrollIntoViewOptions);
|
||||
}, [currentSegmentIndex, transcription, containerRef]);
|
||||
|
||||
if (!transcription?.result) {
|
||||
if (!transcription?.result?.timeline) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -104,6 +104,7 @@ export const AssistantMessageComponent = (props: {
|
||||
speech.text.length > 20
|
||||
? speech.text.substring(0, 17).trim() + "..."
|
||||
: speech.text,
|
||||
originalText: speech.text,
|
||||
});
|
||||
setResourcing(false);
|
||||
}
|
||||
@@ -251,7 +252,7 @@ export const AssistantMessageComponent = (props: {
|
||||
</SheetClose>
|
||||
</SheetHeader>
|
||||
|
||||
{Boolean(speech) && <AudioPlayer md5={speech.md5} />}
|
||||
{Boolean(speech) && shadowing && <AudioPlayer md5={speech.md5} />}
|
||||
</SheetContent>
|
||||
</Sheet>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user