mirror of
https://github.com/koodo-reader/koodo-reader.git
synced 2026-06-16 11:50:41 -04:00
feat: add role analysis messages and improve page end detection for multi-role TTS
This commit is contained in:
@@ -161,6 +161,8 @@
|
||||
"Purchase more quota": "购买更多额度",
|
||||
"You have exhausted your daily free AI voice character quota. Please purchase more quota to continue using this feature or wait until the quota resets. You can also use other TTS voices instead.": "您的每日免费 AI 语音字符额度已用完,请购买更多额度以继续使用此功能,或等待额度重置。您也可以改用其他 TTS 语音。",
|
||||
"Audio loading failed, stopped playback": "音频加载失败,已停止播放",
|
||||
"Analysis failed": "分析失败",
|
||||
"Analyzing roles, please wait...": "正在分析角色,请稍候...",
|
||||
"Compare Free and Pro features": "免费版和专业版功能对比",
|
||||
"Recommended (use with Nutstore)": "推荐使用(配合坚果云)",
|
||||
"Failed to export": "导出失败",
|
||||
|
||||
@@ -307,7 +307,6 @@ class TextToSpeech extends React.Component<
|
||||
id: "tts-load",
|
||||
});
|
||||
let res = await getSplitSentence(nodeTextList);
|
||||
toast.dismiss("tts-load");
|
||||
console.log(res, "res");
|
||||
let narratorVoice =
|
||||
ConfigService.getReaderConfig("multiRoleNarratorVoice") ||
|
||||
@@ -427,11 +426,21 @@ class TextToSpeech extends React.Component<
|
||||
|
||||
lastVisibleTextList = rawNodeList.flat();
|
||||
}
|
||||
|
||||
if (
|
||||
console.log(lastVisibleTextList, this.nodeList, "dfghfgjdfjjhgj");
|
||||
let isReachPageEnd =
|
||||
this.nodeList[index].text ===
|
||||
lastVisibleTextList[lastVisibleTextList.length - 1]
|
||||
) {
|
||||
lastVisibleTextList[lastVisibleTextList.length - 1];
|
||||
if (this.state.multiRoleEnabled) {
|
||||
isReachPageEnd =
|
||||
this.nodeList[index].text.includes(
|
||||
lastVisibleTextList[lastVisibleTextList.length - 1]
|
||||
) ||
|
||||
lastVisibleTextList[lastVisibleTextList.length - 1].includes(
|
||||
this.nodeList[index].text
|
||||
);
|
||||
}
|
||||
|
||||
if (isReachPageEnd) {
|
||||
if (
|
||||
this.props.currentBook.format === "PDF" &&
|
||||
ConfigService.getReaderConfig("isConvertPDF") !== "yes"
|
||||
@@ -494,10 +503,19 @@ class TextToSpeech extends React.Component<
|
||||
|
||||
lastVisibleTextList = rawNodeList.flat();
|
||||
}
|
||||
if (
|
||||
let isReachPageEnd =
|
||||
this.nodeList[index].text ===
|
||||
lastVisibleTextList[lastVisibleTextList.length - 1]
|
||||
) {
|
||||
lastVisibleTextList[lastVisibleTextList.length - 1];
|
||||
if (this.state.multiRoleEnabled) {
|
||||
isReachPageEnd =
|
||||
this.nodeList[index].text.includes(
|
||||
lastVisibleTextList[lastVisibleTextList.length - 1]
|
||||
) ||
|
||||
lastVisibleTextList[lastVisibleTextList.length - 1].includes(
|
||||
this.nodeList[index].text
|
||||
);
|
||||
}
|
||||
if (isReachPageEnd) {
|
||||
if (
|
||||
this.props.currentBook.format === "PDF" &&
|
||||
ConfigService.getReaderConfig("isConvertPDF") !== "yes"
|
||||
|
||||
Reference in New Issue
Block a user