Skip to content

Commit 100b08d

Browse files
committed
multi-language support
1 parent 5de88c8 commit 100b08d

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

java-ai/src/main/java/oracleai/aiholo/AIHoloController.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,9 @@ public String play(@RequestParam("question") String question,
8484
System.out.println(
8585
"play question: " + question + " selectedMode: " + selectedMode +
8686
" languagecode:"+ languagecode+ " voicename:"+ voicename);
87+
question = "qual é o videogame mais popular";
88+
System.out.println(
89+
"modified question: " + question );
8790
theValue = "question";
8891
String filePath = "C:/Users/opc/aiholo_output.txt";
8992
try (FileWriter writer = new FileWriter(filePath)) {
@@ -229,7 +232,7 @@ public String executeSandbox(String cummulativeResult) {
229232

230233
public void TTS(String fileName, String text, String languageCode, String voicename) throws Exception {
231234
try (TextToSpeechClient textToSpeechClient = TextToSpeechClient.create()) {
232-
System.out.println("in TTS languagecode:" + languageCode + " text:"+text);
235+
System.out.println("in TTS languagecode:" + languageCode + " voicename:" + voicename + " text:" + text);
233236
SynthesisInput input = SynthesisInput.newBuilder().setText(
234237
// "最受欢迎的游戏是Pods Of Kon。").build();
235238
text).build();

java-ai/src/main/resources/static/aiholo/AIHolo-Brazil.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ <h1>Oracle Database hologramas de IA interativos</h1>
151151
}
152152
const selectedMode = document.querySelector('input[name="mode"]:checked').value;
153153
const modifiedText = `${transcriptionText} . responda em 20 palavras ou menos`;
154-
const apiUrl = `http://141.148.204.74:8444/aiholo/play?question=${encodeURIComponent(modifiedText)}&selectedMode=${encodeURIComponent(selectedMode)}&languagecode=${encodeURIComponent("pt-BR")}&voicename=${encodeURIComponent("pt-BR-Wavenet-B")}`;
154+
const apiUrl = `http://141.148.204.74:8444/aiholo/play?question=${encodeURIComponent(modifiedText)}&selectedMode=${encodeURIComponent(selectedMode)}&languagecode=${encodeURIComponent("pt-BR")}&voicename=${encodeURIComponent("pt-BR-Wavenet-D")}`;
155155
try {
156156
const response = await fetch(apiUrl, {
157157
method: "GET",

0 commit comments

Comments
 (0)