try { Class voiceClass = Class.forName(voiceClassName);  System.out.println("Creating " + voiceClassName + "...");  emacsVoice = (Voice) voiceClass.newInstance();  if (emacsVoice instanceof MbrolaVoice) { try { (new MbrolaVoiceValidator((MbrolaVoice) emacsVoice)). validate(); } catch (ValidationException ve) { System.err.println(ve.getMessage()); throw new IllegalStateException ("Problem starting MBROLA voice"); } }  System.out.println("Loading " + voiceClassName + "...");  emacsVoice.getFeatures().setString (Voice.DATABASE_NAME, diphoneDatabase); emacsVoice.setLexicon(new CMULexicon()); emacsVoice.setOutputQueue(Voice.createOutputThread()); emacsVoice.allocate(); emacsVoice.setAudioPlayer(new JavaStreamingAudioPlayer());  System.out.println("...Ready");  } catch (Exception e) { System.out.println("Error creating " + voiceClassName); System.exit(1); }
emacsVoice.allocate(); emacsVoice.setAudioPlayer(new JavaStreamingAudioPlayer());
    private void createVoice() {	String voiceClassName = System.getProperty	    ("voiceClass", "com.sun.speech.freetts.en.us.CMUDiphoneVoice");	String diphoneDatabase = System.getProperty	    ("diphoneDatabase", "cmu_kal/diphone_units16.bin");	try {	    Class voiceClass = Class.forName(voiceClassName);	    System.out.println("Creating " + voiceClassName + "...");	    emacsVoice = (Voice) voiceClass.newInstance();            if (emacsVoice instanceof MbrolaVoice) {                try {                    (new MbrolaVoiceValidator((MbrolaVoice) emacsVoice)).                        validate();                } catch (ValidationException ve) {                    System.err.println(ve.getMessage());                    throw new IllegalStateException                        ("Problem starting MBROLA voice");                }            }	    System.out.println("Loading " + voiceClassName + "...");	    emacsVoice.getFeatures().setString		(Voice.DATABASE_NAME, diphoneDatabase);	    emacsVoice.setLexicon(new CMULexicon());	    emacsVoice.setOutputQueue(Voice.createOutputThread());	    emacsVoice.allocate();	    emacsVoice.setAudioPlayer(new JavaStreamingAudioPlayer());	    System.out.println("...Ready");	} catch (Exception e) {	    System.out.println("Error creating " + voiceClassName);	    System.exit(1);	}    }