Skip to content

Commit aac437d

Browse files
committed
add speech test case for second voice
1 parent 886b2e9 commit aac437d

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

core/com.intellijava.core/src/test/java/com/intellijava/core/GoogleSpeechTest.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,4 +100,23 @@ public void testText2FemaleRemoteSpeecModel() {
100100
}
101101
}
102102
}
103+
104+
@Test
105+
public void testText2FemaleRemoteSpeecModel2() {
106+
SpeechInput input = new SpeechInput("Hi, I am Intelligent Java.", Gender.MALE);
107+
108+
RemoteSpeechModel model = new RemoteSpeechModel(apiKey, SpeechModels.google);
109+
110+
try {
111+
byte[] decodedAudio = model.generateEnglishText(input);
112+
assert AudioHelper.saveTempAudio(decodedAudio) == true;
113+
AudioHelper.deleteTempAudio();
114+
} catch (IOException e) {
115+
if (apiKey.isBlank()) {
116+
System.out.print("testRemoteSpeech set the API key to run the test case.");
117+
} else {
118+
fail("testRemoteSpeech failed with exception: " + e.getMessage());
119+
}
120+
}
121+
}
103122
}

0 commit comments

Comments
 (0)