Alguem poderia me ajudar a eliminar os erros java.lang.ExceptionInInitializerError
Porque será que esta caindo nestes erro?
Já tentei usar try …catch(){mensagem…, mas ai so cai nesta mensagem e nao executa o que esta dentro
Este é um codigo de sintese de voz disponivel do FurbSpeech
Exception in thread "main" java.lang.ExceptionInInitializerError
at br.furb.api.furbspeech.synth.SynthesizerFactory.getSynthesizer(SynthesizerFactory.java:26)
at br.furb.api.furbspeech.FurbSpeech.speech(FurbSpeech.java:120)
at br.furb.api.furbspeech.FurbSpeech.main(FurbSpeech.java:48)
Caused by: java.lang.NullPointerException
at br.furb.api.furbspeech.synth.MBrolaSynthesizer.<clinit>(MBrolaSynthesizer.java:35)
... 3 more
Tudo bem Pedro_GTI, ja valeu só por estar tentando me ajudar
[code]package br.furb.api.furbspeech.synth;
public class SynthesizerFactory {
public static Synthesizer getSynthesizer() {
// TODO: in the future, when I have more implementations of synthesizers,
// I'll need to check some config file to know which constructor to invoke.
return new MBrolaSynthesizer();
}
Acrescentei esta linha em negrito, inclusive a primeira mensagem aparece,
Esse é o main do FurbSpeech.java
[code]public static void main(String []args){
System.out.println("Aplicativo iniciado...");
[b]File audio = new FurbSpeech().text("Rua antônio da veiga").to().speech();[/b]
System.out.println("Finalizando.....");
}[/code]
aqui é onde recebo este texto, incluisve coloquei esta mensagem para ver se executa e executou
public FurbSpeech text(String text) {
this.text = text;
System.out.println("texto pego");///LINHA ADICIONADA PRA TESTES
return this;
}
aqui é onde comeca a parte da leitura, esta tambem executa
public FurbSpeech withVoice(File voiceFile) {
this.voiceFile = voiceFile;
System.out.println("voz tratada");
return this;
}
ficando assim a mensagem de erro completa
Aplicativo iniciado...
texto pego
criado arquivo
Exception in thread "main" java.lang.ExceptionInInitializerError
at br.furb.api.furbspeech.synth.SynthesizerFactory.getSynthesizer(SynthesizerFactory.java:26)
at br.furb.api.furbspeech.FurbSpeech.speech(FurbSpeech.java:120)
at br.furb.api.furbspeech.FurbSpeech.main(FurbSpeech.java:48)
Caused by: java.lang.NullPointerException
at br.furb.api.furbspeech.synth.MBrolaSynthesizer.<clinit>(MBrolaSynthesizer.java:35)
... 3 more
public static final File VOICE_BR1 = new File(ComponentUtils.getClearDirAbsolutePath(FurbSpeech.class.getClassLoader().getResource("synthesizer/mbrola/br1").getFile()));
public static final File VOICE_BR1 = new File(ComponentUtils.getClearDirAbsolutePath(FurbSpeech.class.getClassLoader().getResource("synthesizer/mbrola/br1").getFile()));
Bota um break point dentro do método speech(), e acompanha o fluxo, dentro dele deve ter alguma coisa dano trela, não da pra saber olhando, debuga ai pra ver…
desculpem a gafe
o erro era por cauda disso
public static final File VOICE_BR1 = new File(ComponentUtils.getClearDirAbsolutePath(FurbSpeech.class.getClassLoader().getResource(“resources/synthesizer/mbrola/br1”).getFile()));
o caminho estava mesmo errado,
Bom o audio ainda nao funciona, o arquivo nao esta sendo criado de maneira nenhuma,
mas estou tentando aqui, quem sabe é algo que esta passando despercebido, vou ter q ver