Skip to content

Commit 56a19fe

Browse files
test(stt,tts): reinsert hand edits and update voice models
1 parent f03ea0b commit 56a19fe

File tree

3 files changed

+14
-15
lines changed

3 files changed

+14
-15
lines changed

speech-to-text/src/test/java/com/ibm/watson/speech_to_text/v1/SpeechToTextTest.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ public void testGetModelNoOptions() throws Throwable {
212212
public void testRecognizeWOptions() throws Throwable {
213213
// Register a mock response
214214
String mockResponseBody =
215-
"{\"results\": [{\"final\": true, \"alternatives\": [{\"transcript\": \"transcript\", \"confidence\": 0, \"timestamps\": [\"timestamps\"], \"word_confidence\": [\"wordConfidence\"]}], \"keywords_result\": {\"mapKey\": [{\"normalized_text\": \"normalizedText\", \"start_time\": 9, \"end_time\": 7, \"confidence\": 0}]}, \"word_alternatives\": [{\"start_time\": 9, \"end_time\": 7, \"alternatives\": [{\"confidence\": 0, \"word\": \"word\"}]}], \"end_of_utterance\": \"end_of_data\"}], \"result_index\": 11, \"speaker_labels\": [{\"from\": 4, \"to\": 2, \"speaker\": 7, \"confidence\": 10, \"final\": true}], \"processing_metrics\": {\"processed_audio\": {\"received\": 8, \"seen_by_engine\": 12, \"transcription\": 13, \"speaker_labels\": 13}, \"wall_clock_since_first_byte_received\": 31, \"periodic\": true}, \"audio_metrics\": {\"sampling_interval\": 16, \"accumulated\": {\"final\": true, \"end_time\": 7, \"signal_to_noise_ratio\": 18, \"speech_ratio\": 11, \"high_frequency_loss\": 17, \"direct_current_offset\": [{\"begin\": 5, \"end\": 3, \"count\": 5}], \"clipping_rate\": [{\"begin\": 5, \"end\": 3, \"count\": 5}], \"speech_level\": [{\"begin\": 5, \"end\": 3, \"count\": 5}], \"non_speech_level\": [{\"begin\": 5, \"end\": 3, \"count\": 5}]}}, \"warnings\": [\"warnings\"]}";
215+
"{\"results\": [{\"final\": true, \"alternatives\": [{\"transcript\": \"transcript\", \"confidence\": 0, \"timestamps\": [[\"timestamps\"]], \"word_confidence\": [[\"wordConfidence\"]]}], \"keywords_result\": {\"mapKey\": [{\"normalized_text\": \"normalizedText\", \"start_time\": 9, \"end_time\": 7, \"confidence\": 0}]}, \"word_alternatives\": [{\"start_time\": 9, \"end_time\": 7, \"alternatives\": [{\"confidence\": 0, \"word\": \"word\"}]}], \"end_of_utterance\": \"end_of_data\"}], \"result_index\": 11, \"speaker_labels\": [{\"from\": 4, \"to\": 2, \"speaker\": 7, \"confidence\": 10, \"final\": true}], \"processing_metrics\": {\"processed_audio\": {\"received\": 8, \"seen_by_engine\": 12, \"transcription\": 13, \"speaker_labels\": 13}, \"wall_clock_since_first_byte_received\": 31, \"periodic\": true}, \"audio_metrics\": {\"sampling_interval\": 16, \"accumulated\": {\"final\": true, \"end_time\": 7, \"signal_to_noise_ratio\": 18, \"speech_ratio\": 11, \"high_frequency_loss\": 17, \"direct_current_offset\": [{\"begin\": 5, \"end\": 3, \"count\": 5}], \"clipping_rate\": [{\"begin\": 5, \"end\": 3, \"count\": 5}], \"speech_level\": [{\"begin\": 5, \"end\": 3, \"count\": 5}], \"non_speech_level\": [{\"begin\": 5, \"end\": 3, \"count\": 5}]}}, \"warnings\": [\"warnings\"]}";
216216
String recognizePath = "/v1/recognize";
217217
server.enqueue(
218218
new MockResponse()
@@ -424,7 +424,7 @@ public void testUnregisterCallbackNoOptions() throws Throwable {
424424
public void testCreateJobWOptions() throws Throwable {
425425
// Register a mock response
426426
String mockResponseBody =
427-
"{\"id\": \"id\", \"status\": \"waiting\", \"created\": \"created\", \"updated\": \"updated\", \"url\": \"url\", \"user_token\": \"userToken\", \"results\": [{\"results\": [{\"final\": true, \"alternatives\": [{\"transcript\": \"transcript\", \"confidence\": 0, \"timestamps\": [\"timestamps\"], \"word_confidence\": [\"wordConfidence\"]}], \"keywords_result\": {\"mapKey\": [{\"normalized_text\": \"normalizedText\", \"start_time\": 9, \"end_time\": 7, \"confidence\": 0}]}, \"word_alternatives\": [{\"start_time\": 9, \"end_time\": 7, \"alternatives\": [{\"confidence\": 0, \"word\": \"word\"}]}], \"end_of_utterance\": \"end_of_data\"}], \"result_index\": 11, \"speaker_labels\": [{\"from\": 4, \"to\": 2, \"speaker\": 7, \"confidence\": 10, \"final\": true}], \"processing_metrics\": {\"processed_audio\": {\"received\": 8, \"seen_by_engine\": 12, \"transcription\": 13, \"speaker_labels\": 13}, \"wall_clock_since_first_byte_received\": 31, \"periodic\": true}, \"audio_metrics\": {\"sampling_interval\": 16, \"accumulated\": {\"final\": true, \"end_time\": 7, \"signal_to_noise_ratio\": 18, \"speech_ratio\": 11, \"high_frequency_loss\": 17, \"direct_current_offset\": [{\"begin\": 5, \"end\": 3, \"count\": 5}], \"clipping_rate\": [{\"begin\": 5, \"end\": 3, \"count\": 5}], \"speech_level\": [{\"begin\": 5, \"end\": 3, \"count\": 5}], \"non_speech_level\": [{\"begin\": 5, \"end\": 3, \"count\": 5}]}}, \"warnings\": [\"warnings\"]}], \"warnings\": [\"warnings\"]}";
427+
"{\"id\": \"id\", \"status\": \"waiting\", \"created\": \"created\", \"updated\": \"updated\", \"url\": \"url\", \"user_token\": \"userToken\", \"results\": [{\"results\": [{\"final\": true, \"alternatives\": [{\"transcript\": \"transcript\", \"confidence\": 0, \"timestamps\": [[\"timestamps\"]], \"word_confidence\": [[\"wordConfidence\"]]}], \"keywords_result\": {\"mapKey\": [{\"normalized_text\": \"normalizedText\", \"start_time\": 9, \"end_time\": 7, \"confidence\": 0}]}, \"word_alternatives\": [{\"start_time\": 9, \"end_time\": 7, \"alternatives\": [{\"confidence\": 0, \"word\": \"word\"}]}], \"end_of_utterance\": \"end_of_data\"}], \"result_index\": 11, \"speaker_labels\": [{\"from\": 4, \"to\": 2, \"speaker\": 7, \"confidence\": 10, \"final\": true}], \"processing_metrics\": {\"processed_audio\": {\"received\": 8, \"seen_by_engine\": 12, \"transcription\": 13, \"speaker_labels\": 13}, \"wall_clock_since_first_byte_received\": 31, \"periodic\": true}, \"audio_metrics\": {\"sampling_interval\": 16, \"accumulated\": {\"final\": true, \"end_time\": 7, \"signal_to_noise_ratio\": 18, \"speech_ratio\": 11, \"high_frequency_loss\": 17, \"direct_current_offset\": [{\"begin\": 5, \"end\": 3, \"count\": 5}], \"clipping_rate\": [{\"begin\": 5, \"end\": 3, \"count\": 5}], \"speech_level\": [{\"begin\": 5, \"end\": 3, \"count\": 5}], \"non_speech_level\": [{\"begin\": 5, \"end\": 3, \"count\": 5}]}}, \"warnings\": [\"warnings\"]}], \"warnings\": [\"warnings\"]}";
428428
String createJobPath = "/v1/recognitions";
429429
server.enqueue(
430430
new MockResponse()
@@ -542,7 +542,7 @@ public void testCreateJobNoOptions() throws Throwable {
542542
public void testCheckJobsWOptions() throws Throwable {
543543
// Register a mock response
544544
String mockResponseBody =
545-
"{\"recognitions\": [{\"id\": \"id\", \"status\": \"waiting\", \"created\": \"created\", \"updated\": \"updated\", \"url\": \"url\", \"user_token\": \"userToken\", \"results\": [{\"results\": [{\"final\": true, \"alternatives\": [{\"transcript\": \"transcript\", \"confidence\": 0, \"timestamps\": [\"timestamps\"], \"word_confidence\": [\"wordConfidence\"]}], \"keywords_result\": {\"mapKey\": [{\"normalized_text\": \"normalizedText\", \"start_time\": 9, \"end_time\": 7, \"confidence\": 0}]}, \"word_alternatives\": [{\"start_time\": 9, \"end_time\": 7, \"alternatives\": [{\"confidence\": 0, \"word\": \"word\"}]}], \"end_of_utterance\": \"end_of_data\"}], \"result_index\": 11, \"speaker_labels\": [{\"from\": 4, \"to\": 2, \"speaker\": 7, \"confidence\": 10, \"final\": true}], \"processing_metrics\": {\"processed_audio\": {\"received\": 8, \"seen_by_engine\": 12, \"transcription\": 13, \"speaker_labels\": 13}, \"wall_clock_since_first_byte_received\": 31, \"periodic\": true}, \"audio_metrics\": {\"sampling_interval\": 16, \"accumulated\": {\"final\": true, \"end_time\": 7, \"signal_to_noise_ratio\": 18, \"speech_ratio\": 11, \"high_frequency_loss\": 17, \"direct_current_offset\": [{\"begin\": 5, \"end\": 3, \"count\": 5}], \"clipping_rate\": [{\"begin\": 5, \"end\": 3, \"count\": 5}], \"speech_level\": [{\"begin\": 5, \"end\": 3, \"count\": 5}], \"non_speech_level\": [{\"begin\": 5, \"end\": 3, \"count\": 5}]}}, \"warnings\": [\"warnings\"]}], \"warnings\": [\"warnings\"]}]}";
545+
"{\"recognitions\": [{\"id\": \"id\", \"status\": \"waiting\", \"created\": \"created\", \"updated\": \"updated\", \"url\": \"url\", \"user_token\": \"userToken\", \"results\": [{\"results\": [{\"final\": true, \"alternatives\": [{\"transcript\": \"transcript\", \"confidence\": 0, \"timestamps\": [[\"timestamps\"]], \"word_confidence\": [[\"wordConfidence\"]]}], \"keywords_result\": {\"mapKey\": [{\"normalized_text\": \"normalizedText\", \"start_time\": 9, \"end_time\": 7, \"confidence\": 0}]}, \"word_alternatives\": [{\"start_time\": 9, \"end_time\": 7, \"alternatives\": [{\"confidence\": 0, \"word\": \"word\"}]}], \"end_of_utterance\": \"end_of_data\"}], \"result_index\": 11, \"speaker_labels\": [{\"from\": 4, \"to\": 2, \"speaker\": 7, \"confidence\": 10, \"final\": true}], \"processing_metrics\": {\"processed_audio\": {\"received\": 8, \"seen_by_engine\": 12, \"transcription\": 13, \"speaker_labels\": 13}, \"wall_clock_since_first_byte_received\": 31, \"periodic\": true}, \"audio_metrics\": {\"sampling_interval\": 16, \"accumulated\": {\"final\": true, \"end_time\": 7, \"signal_to_noise_ratio\": 18, \"speech_ratio\": 11, \"high_frequency_loss\": 17, \"direct_current_offset\": [{\"begin\": 5, \"end\": 3, \"count\": 5}], \"clipping_rate\": [{\"begin\": 5, \"end\": 3, \"count\": 5}], \"speech_level\": [{\"begin\": 5, \"end\": 3, \"count\": 5}], \"non_speech_level\": [{\"begin\": 5, \"end\": 3, \"count\": 5}]}}, \"warnings\": [\"warnings\"]}], \"warnings\": [\"warnings\"]}]}";
546546
String checkJobsPath = "/v1/recognitions";
547547
server.enqueue(
548548
new MockResponse()
@@ -587,8 +587,7 @@ public void testCheckJobsWRetries() throws Throwable {
587587
public void testCheckJobWOptions() throws Throwable {
588588
// Register a mock response
589589
String mockResponseBody =
590-
"{\"id\": \"id\", \"status\": \"waiting\", \"created\": \"created\", \"updated\": \"updated\", \"url\": \"url\", \"user_token\": \"userToken\", \"results\": [{\"results\": [{\"final\": true, \"alternatives\": [{\"transcript\": \"transcript\", \"confidence\": 0, \"timestamps\": [\"timestamps\"], \"word_confidence\": [\"wordConfidence\"]}], \"keywords_result\": {\"mapKey\": [{\"normalized_text\": \"normalizedText\", \"start_time\": 9, \"end_time\": 7, \"confidence\": 0}]}, \"word_alternatives\": [{\"start_time\": 9, \"end_time\": 7, \"alternatives\": [{\"confidence\": 0, \"word\": \"word\"}]}], \"end_of_utterance\": \"end_of_data\"}], \"result_index\": 11, \"speaker_labels\": [{\"from\": 4, \"to\": 2, \"speaker\": 7, \"confidence\": 10, \"final\": true}], \"processing_metrics\": {\"processed_audio\": {\"received\": 8, \"seen_by_engine\": 12, \"transcription\": 13, \"speaker_labels\": 13}, \"wall_clock_since_first_byte_received\": 31, \"periodic\": true}, \"audio_metrics\": {\"sampling_interval\": 16, \"accumulated\": {\"final\": true, \"end_time\": 7, \"signal_to_noise_ratio\": 18, \"speech_ratio\": 11, \"high_frequency_loss\": 17, \"direct_current_offset\": [{\"begin\": 5, \"end\": 3, \"count\": 5}], \"clipping_rate\": [{\"begin\": 5, \"end\": 3, \"count\": 5}], \"speech_level\": [{\"begin\": 5, \"end\": 3, \"count\": 5}], \"non_speech_level\": [{\"begin\": 5, \"end\": 3, \"count\": 5}]}}, \"warnings\": [\"warnings\"]}], \"warnings\": [\"warnings\"]}";
591-
String checkJobPath = "/v1/recognitions/testString";
590+
"{\"id\": \"id\", \"status\": \"waiting\", \"created\": \"created\", \"updated\": \"updated\", \"url\": \"url\", \"user_token\": \"userToken\", \"results\": [{\"results\": [{\"final\": true, \"alternatives\": [{\"transcript\": \"transcript\", \"confidence\": 0, \"timestamps\": [[\"timestamps\"]], \"word_confidence\": [[\"wordConfidence\"]]}], \"keywords_result\": {\"mapKey\": [{\"normalized_text\": \"normalizedText\", \"start_time\": 9, \"end_time\": 7, \"confidence\": 0}]}, \"word_alternatives\": [{\"start_time\": 9, \"end_time\": 7, \"alternatives\": [{\"confidence\": 0, \"word\": \"word\"}]}], \"end_of_utterance\": \"end_of_data\"}], \"result_index\": 11, \"speaker_labels\": [{\"from\": 4, \"to\": 2, \"speaker\": 7, \"confidence\": 10, \"final\": true}], \"processing_metrics\": {\"processed_audio\": {\"received\": 8, \"seen_by_engine\": 12, \"transcription\": 13, \"speaker_labels\": 13}, \"wall_clock_since_first_byte_received\": 31, \"periodic\": true}, \"audio_metrics\": {\"sampling_interval\": 16, \"accumulated\": {\"final\": true, \"end_time\": 7, \"signal_to_noise_ratio\": 18, \"speech_ratio\": 11, \"high_frequency_loss\": 17, \"direct_current_offset\": [{\"begin\": 5, \"end\": 3, \"count\": 5}], \"clipping_rate\": [{\"begin\": 5, \"end\": 3, \"count\": 5}], \"speech_level\": [{\"begin\": 5, \"end\": 3, \"count\": 5}], \"non_speech_level\": [{\"begin\": 5, \"end\": 3, \"count\": 5}]}}, \"warnings\": [\"warnings\"]}], \"warnings\": [\"warnings\"]}"; String checkJobPath = "/v1/recognitions/testString";
592591
server.enqueue(
593592
new MockResponse()
594593
.setHeader("Content-type", "application/json")

text-to-speech/src/test/java/com/ibm/watson/text_to_speech/v1/CustomizationsIT.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ public void testGetVoiceCustomization() {
205205
GetVoiceOptions getVoiceOptions =
206206
new GetVoiceOptions.Builder()
207207
.customizationId(model.getCustomizationId())
208-
.voice(GetVoiceOptions.Voice.EN_US_ALLISONVOICE)
208+
.voice(GetVoiceOptions.Voice.EN_US_ALLISONV3VOICE)
209209
.build();
210210
final Voice voice = service.getVoice(getVoiceOptions).execute().getResult();
211211

@@ -477,14 +477,14 @@ public void testSynthesize() throws IOException {
477477
SynthesizeOptions synthesizeOptions1 =
478478
new SynthesizeOptions.Builder()
479479
.text(expected.word())
480-
.voice(SynthesizeOptions.Voice.EN_US_MICHAELVOICE)
480+
.voice(SynthesizeOptions.Voice.EN_US_MICHAELV3VOICE)
481481
.accept(HttpMediaType.AUDIO_WAV)
482482
.build();
483483
final InputStream stream1 = service.synthesize(synthesizeOptions1).execute().getResult();
484484
SynthesizeOptions synthesizeOptions2 =
485485
new SynthesizeOptions.Builder()
486486
.text(expected.word())
487-
.voice(SynthesizeOptions.Voice.EN_US_MICHAELVOICE)
487+
.voice(SynthesizeOptions.Voice.EN_US_MICHAELV3VOICE)
488488
.accept(HttpMediaType.AUDIO_WAV)
489489
.customizationId(model.getCustomizationId())
490490
.build();

text-to-speech/src/test/java/com/ibm/watson/text_to_speech/v1/TextToSpeechIT.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ public void testSynthesize() throws IOException {
155155
SynthesizeOptions synthesizeOptions =
156156
new SynthesizeOptions.Builder()
157157
.text(text)
158-
.voice(SynthesizeOptions.Voice.EN_US_LISAVOICE)
158+
.voice(SynthesizeOptions.Voice.EN_US_LISAV3VOICE)
159159
.accept(HttpMediaType.AUDIO_WAV)
160160
.build();
161161
InputStream result = service.synthesize(synthesizeOptions).execute().getResult();
@@ -169,7 +169,7 @@ public void testGetWordPronunciation() {
169169
GetPronunciationOptions getOptions1 =
170170
new GetPronunciationOptions.Builder()
171171
.text(word)
172-
.voice(GetPronunciationOptions.Voice.EN_US_MICHAELVOICE)
172+
.voice(GetPronunciationOptions.Voice.EN_US_MICHAELV3VOICE)
173173
.format(GetPronunciationOptions.Format.IBM)
174174
.build();
175175
Pronunciation pronunciation = service.getPronunciation(getOptions1).execute().getResult();
@@ -188,7 +188,7 @@ public void testGetWordPronunciation() {
188188
GetPronunciationOptions getOptions3 =
189189
new GetPronunciationOptions.Builder()
190190
.text(word)
191-
.voice(GetPronunciationOptions.Voice.EN_US_MICHAELVOICE)
191+
.voice(GetPronunciationOptions.Voice.EN_US_MICHAELV3VOICE)
192192
.build();
193193
pronunciation = service.getPronunciation(getOptions3).execute().getResult();
194194
assertNotNull(pronunciation);
@@ -197,7 +197,7 @@ public void testGetWordPronunciation() {
197197
GetPronunciationOptions getOptions4 =
198198
new GetPronunciationOptions.Builder()
199199
.text(word)
200-
.voice(GetPronunciationOptions.Voice.EN_US_MICHAELVOICE)
200+
.voice(GetPronunciationOptions.Voice.EN_US_MICHAELV3VOICE)
201201
.format(GetPronunciationOptions.Format.IPA)
202202
.build();
203203
pronunciation = service.getPronunciation(getOptions4).execute().getResult();
@@ -217,7 +217,7 @@ public void testSynthesizeAndFixHeader() throws IOException, UnsupportedAudioFil
217217
SynthesizeOptions synthesizeOptions =
218218
new SynthesizeOptions.Builder()
219219
.text(text)
220-
.voice(SynthesizeOptions.Voice.EN_US_LISAVOICE)
220+
.voice(SynthesizeOptions.Voice.EN_US_LISAV3VOICE)
221221
.accept(HttpMediaType.AUDIO_WAV)
222222
.build();
223223
InputStream result = service.synthesize(synthesizeOptions).execute().getResult();
@@ -258,7 +258,7 @@ public void testSynthesizeUsingWebSocket() throws InterruptedException, IOExcept
258258
SynthesizeOptions synthesizeOptions =
259259
new SynthesizeOptions.Builder()
260260
.text(basicText)
261-
.voice(SynthesizeOptions.Voice.EN_US_ALLISONVOICE)
261+
.voice(SynthesizeOptions.Voice.EN_US_ALLISONV3VOICE)
262262
.accept(HttpMediaType.AUDIO_OGG)
263263
.timings(Collections.singletonList("words"))
264264
.build();
@@ -335,7 +335,7 @@ public void testSynthesizeUsingWebSocketWithSsml() throws InterruptedException {
335335
SynthesizeOptions synthesizeOptions =
336336
new SynthesizeOptions.Builder()
337337
.text(ssmlText)
338-
.voice(SynthesizeOptions.Voice.EN_US_ALLISONVOICE)
338+
.voice(SynthesizeOptions.Voice.EN_US_ALLISONV3VOICE)
339339
.accept(HttpMediaType.AUDIO_OGG)
340340
.build();
341341

0 commit comments

Comments
 (0)