use of com.ibm.watson.developer_cloud.text_to_speech.v1.model.AddWordOptions in project java-sdk by watson-developer-cloud.
the class CustomizationsIT method testSynthesize.
/**
* Test synthesize.
*
* @throws IOException Signals that an I/O exception has occurred.
*/
@Test
public void testSynthesize() throws IOException {
model = createVoiceModel();
final Word expected = instantiateWords().get(0);
AddWordOptions addOptions = new AddWordOptions.Builder().word(expected.getWord()).translation(expected.getTranslation()).customizationId(model.getCustomizationId()).build();
service.addWord(addOptions).execute();
SynthesizeOptions synthesizeOptions1 = new SynthesizeOptions.Builder().text(expected.getWord()).voice(SynthesizeOptions.Voice.EN_US_MICHAELVOICE).accept(SynthesizeOptions.Accept.AUDIO_WAV).build();
final InputStream stream1 = service.synthesize(synthesizeOptions1).execute();
SynthesizeOptions synthesizeOptions2 = new SynthesizeOptions.Builder().text(expected.getWord()).voice(SynthesizeOptions.Voice.EN_US_MICHAELVOICE).accept(SynthesizeOptions.Accept.AUDIO_WAV).customizationId(model.getCustomizationId()).build();
final InputStream stream2 = service.synthesize(synthesizeOptions2).execute();
assertFalse(TestUtils.streamContentEquals(stream1, stream2));
}
Aggregations