歡迎使用香港圍頭話及客家話文字轉語音(Text-to-Speech)朗讀器!
diff --git a/src/App.tsx b/src/App.tsx
index 234e97f..333aedd 100644
--- a/src/App.tsx
+++ b/src/App.tsx
@@ -34,8 +34,21 @@ export default function App() {
}
}, [textArea, btnAddSentence]);
+ const [screenshotMode, setScreenshotMode] = useState(false);
const addSentence = useCallback(() => {
if (!textArea.current) return;
+ if (textArea.current.value === "_screenshot") {
+ setScreenshotMode(true);
+ setSentences([
+ { language: "waitau", voice: "male", inferenceMode: "online", voiceSpeed: 1, syllables: segment("天地玄黃,宇宙洪荒。") },
+ { language: "waitau", voice: "female", inferenceMode: "online", voiceSpeed: 1, syllables: segment("日月盈昃,辰宿列張。") },
+ { language: "hakka", voice: "male", inferenceMode: "online", voiceSpeed: 1, syllables: segment("天地玄黃,宇宙洪荒。") },
+ { language: "hakka", voice: "female", inferenceMode: "online", voiceSpeed: 1, syllables: segment("日月盈昃,辰宿列張。") },
+ ]);
+ textArea.current.value = "";
+ resizeElements();
+ return;
+ }
setSentences([
...textArea.current.value.split("\n").flatMap(text => (text.trim() ? [{ language, voice, inferenceMode, voiceSpeed, syllables: segment(text) }] : [])),
...sentences,
@@ -83,12 +96,12 @@ export default function App() {
-