Cloudgarden's Discussion Board
Forums: Search: Several forums are available for people to post questions/comments about Java Speech or any of the CloudGarden products. As more messages are posted this discussion board should provide a useful, searchable, support database.
o AliceTalker (42)
o JSAPI Projects (69)
o Java Speech API (857)
o Jigloo GUI Builder for Eclipse (3322)
o SwingScroller (0)
o US Election 2004 (3)
Searches text and subject fields in all forums. The search matches as many words as possible. Don't use "AND" or "OR".
Latest "Java Speech API" Topics [ Start new "Java Speech API" Topic  ]

Cloudgarden Discussion Board  
This topic has 0 replies.       [ << Previous Topic | Start of Thread | >> Next Topic ]
Problem changing voice
Author: Fiona52
09/06/10 05:52 Reply
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