freetts

Status
Nicht offen für weitere Antworten.

loadbrain

Bekanntes Mitglied
Hallo,
ich habe ein Problem mit FreeTTS.
Habe mir das laut Webseite installiert, dann in NB6 ein HelloWorld Demo importiert, mit F6 laufen lassen, geht ohne Probleme, Stimme spricht.
Dann kompiliert, versucht aus dist aufzurufen, dann kommt die Meldung:


All voices available:

Using voice: kevin16
Cannot find a voice named kevin16. Please specify a different voice.

Quellcode sieht so aus:

Code:
/**
 * Copyright 2003 Sun Microsystems, Inc.
 * 
 * See the file "license.terms" for information on usage and
 * redistribution of this file, and for a DISCLAIMER OF ALL 
 * WARRANTIES.
 */
import com.sun.speech.freetts.Voice;
import com.sun.speech.freetts.VoiceManager;
import com.sun.speech.freetts.VoiceDirectory;

/**
 * Simple program to demonstrate the use of the FreeTTS speech
 * synthesizer.  This simple program shows how to use FreeTTS
 * without requiring the Java Speech API (JSAPI).
 */
public class FreeTTSHelloWorld {

    /**
     * Example of how to list all the known voices.
     */
    public static void listAllVoices() {
        System.out.println();
        System.out.println("All voices available:");        
        VoiceManager voiceManager = VoiceManager.getInstance();
        Voice[] voices = voiceManager.getVoices();
        for (int i = 0; i < voices.length; i++) {
            System.out.println("    " + voices[i].getName()
                               + " (" + voices[i].getDomain() + " domain)");
        }
    }

    public static void main(String[] args) {

        listAllVoices();
        
        String voiceName = (args.length > 0)
            ? args[0]
            : "kevin16";
        
        System.out.println();
        System.out.println("Using voice: " + voiceName);
        
        /* The VoiceManager manages all the voices for FreeTTS.
         */
        VoiceManager voiceManager = VoiceManager.getInstance();
        Voice helloVoice = voiceManager.getVoice(voiceName);

        if (helloVoice == null) {
            System.err.println(
                "Cannot find a voice named "
                + voiceName + ".  Please specify a different voice.");
            System.exit(1);
        }
        
        /* Allocates the resources for the voice.
         */
        helloVoice.allocate();
        
        /* Synthesize speech.
         */
        helloVoice.speak("Thank you for giving me a voice. "
                         + "I'm so glad to say hello to this world.");

        /* Clean up and leave.
         */
        helloVoice.deallocate();
        System.exit(0);
    }
}

spich, der VoiceManager findet also keine Stimmen.
Und ich habe keine Ahnung, wo ich die finden kann oder mit einbauen muss, da er sie aus NB raus ja hat...

Kennst sich da jemand aus???
 
I

ines

Gast
also wenn etwas in nb geht und ausserhalb nicht, dann hat es bei mir immer daran gelegen, dass ich die pfade nicht beachtet habe, beispielsweise die library-angaben, die in nb komfortabel gehandhabt werden oder auch pfade zu benötigten dateien

hier hilft zunächst die library einträge innerhalb netbeans durchzusehen und evtl. auch das build-skript anzuschauen .. allerdings bin ich da auch kein profi in dieser hinsicht ...
 

loadbrain

Bekanntes Mitglied
Ok, habe es geschafft, es haben tatsächlich einige jars gefehlt...

Für alle, denen es evtl. hilft.

HelloWorld demo:

freetts.jar
cmu_us_kal.jar
cmulex.jar
en_us.jar

in Netbeans unter Properties->Libraries mit eingeben, dann geht es.
 
Status
Nicht offen für weitere Antworten.
Ähnliche Java Themen
  Titel Forum Antworten Datum
S freetts mit Eclipse Java Basics - Anfänger-Themen 3

Ähnliche Java Themen

Neue Themen


Oben