This discussion is archived
1 Reply Latest reply: Aug 20, 2010 12:13 PM by DarrylBurke RSS

Problem changing synthesiser voices

843802 Newbie
Currently Being Moderated
I have written a TTS application, and have included the option to change the voice of the synthesiser. The user selects a voice name from the list of available voices, and the position of the voice in the SynthesiserModeDesc voice array is noted, as well as the position of the SynthesiserModeDesc in the EngineList array.

The numbers being passed across are correct, and have included several system.out's to print the name of the current voice being used, which show that the voice has supposedly changed. Despite this, when it comes to output, the text is spoken in the same voice, no matter what voice has been selected and changed from the list.

Here is the code which is supposed to change the voice.

public Output(String toBe, Interface listener, int smde, int ve) throws IllegalArgumentException, EngineException, InterruptedException {
beSpoken = toBe;
this.listener = listener;
System.out.println("" + smde);

EngineList syns = Central.availableSynthesizers(null);
SynthesizerModeDesc synDesc;

final SynthesizerModeDesc desc = (SynthesizerModeDesc) syns.elementAt(smde);
synDesc = desc;


synth = Central.createSynthesizer(synDesc);
synth.getSynthesizerProperties().setVoice(synDesc.getVoices()[ve]);
System.out.println(synth.getSynthesizerProperties().getVoice());
synth.allocate();

synth.waitEngineState(synth.ALLOCATED);
}

Any help on the matter wouldn't go amiss :)

Thanks,
Fiona