1

これは私のコードです

import com.sun.speech.freetts.Voice;
import com.sun.speech.freetts.VoiceManager;   


public class FreeTTS {

 private static final String VOICENAME_kevin = "kevin";
 private String text; // string to speech

 public FreeTTS(String text) {
  this.text = text;
 }

 public void speak() {
  Voice voice;
  VoiceManager voiceManager = VoiceManager.getInstance();
  voice = voiceManager.getVoice(VOICENAME_kevin);
  voice.allocate();
  voice.speak(text);
 }

 public static void main(String[] args) {
  String text = "FreeTTS was written by the Sun Microsystems Laboratories "
    + "Speech Team and is based on CMU's Flite engine.";
  FreeTTS freeTTS = new FreeTTS(text);
  freeTTS.speak();
 }
}

freetts の lib フォルダーをこのプロジェクトに含めますが、インポートの「com.sun.speech」でエラーが発生します。どんな種類の助けもいただければ幸いです。

4

1 に答える 1