elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Recuerda que debes registrarte en el foro para poder participar (preguntar y responder)


+  Foro de elhacker.net
|-+  Programación
| |-+  Programación General
| | |-+  Java
| | | |-+  Sintetizador de voz para java
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] Ir Abajo Respuesta Imprimir
Autor Tema: Sintetizador de voz para java  (Leído 4,053 veces)
misterguapo30

Desconectado Desconectado

Mensajes: 7


Ver Perfil
Sintetizador de voz para java
« en: 15 Septiembre 2020, 02:12 am »

Buenas, estoy intentando realizando en java un programa (en principio en español).

El cual se escribirá un texto en un JTextField y programa tiene que reproducir el texto mediante
una voz lo más natural posible.

He probado con fretts con speech y antes con mbrola. pero no me deja o no se cambiarle la voz.

¿ese es sintetizado mas adecuado para java o hay otro mejor?

¿Que me aconsejáis?

Gracias


En línea

rub'n


Desconectado Desconectado

Mensajes: 1.217


(e -> λ("live now")); tatuar -> λ("α");


Ver Perfil WWW
Re: Sintetizador de voz para java
« Respuesta #1 en: 20 Septiembre 2020, 00:50 am »

Como estaras usando esa API, tienes codigo? segun si que funciona.


En línea



rubn0x52.com KNOWLEDGE  SHOULD BE FREE.
If you don't have time to read, you don't have the time (or the tools) to write, Simple as that. Stephen ki
misterguapo30

Desconectado Desconectado

Mensajes: 7


Ver Perfil
Re: Sintetizador de voz para java
« Respuesta #2 en: 20 Septiembre 2020, 00:56 am »

Si, he hecho una prueba con el siguiente código:
Código
  1. /*
  2.  * To change this license header, choose License Headers in Project Properties.
  3.  * To change this template file, choose Tools | Templates
  4.  * and open the template in the editor.
  5.  */
  6. package sonido;
  7.  
  8. import java.util.Locale;
  9. import javax.speech.Central;
  10. import javax.speech.synthesis.Synthesizer;
  11. import javax.speech.synthesis.SynthesizerModeDesc;
  12.  
  13. /**
  14.  *
  15.  * @author pcx
  16.  */
  17. public class SonidoSp {
  18.  
  19.    /**
  20.      * @param args the command line arguments
  21.      */
  22.    public static void main(String[] args) {
  23.        // TODO code application logic here
  24.  
  25.  
  26.        try {
  27.            // Set property as Kevin Dictionary
  28.            System.setProperty(
  29.                "freetts.voices",
  30.                "com.sun.speech.freetts.en.us"
  31.                    + ".cmu_us_kal.KevinVoiceDirectory");
  32.  
  33.            // Register Engine
  34.            Central.registerEngineCentral(
  35.                "com.sun.speech.freetts"
  36.                + ".jsapi.FreeTTSEngineCentral");
  37.  
  38.            // Create a Synthesizer
  39.            Synthesizer synthesizer
  40.                = Central.createSynthesizer(
  41.                    new SynthesizerModeDesc(Locale.US));
  42.  
  43.            // Allocate synthesizer
  44.            synthesizer.allocate();
  45.  
  46.            // Resume Synthesizer
  47.            synthesizer.resume();
  48.  
  49.            // Speaks the given text
  50.            // until the queue is empty.
  51.            synthesizer.speakPlainText(
  52.                "hola esto es carnaval tu p**a madre", null);
  53.            synthesizer.waitEngineState(
  54.                Synthesizer.QUEUE_EMPTY);
  55.  
  56.            // Deallocate the Synthesizer.
  57.            synthesizer.deallocate();
  58.        }
  59.  
  60.        catch (Exception e) {
  61.            e.printStackTrace();
  62.        }
  63.  
  64.    }
  65.  
  66. }
  67.  
  68.  

Gracias su interés


[MOD] para publicar código usar las etiquetas GeSHi
« Última modificación: 22 Septiembre 2020, 01:31 am por simorg » En línea

rub'n


Desconectado Desconectado

Mensajes: 1.217


(e -> λ("live now")); tatuar -> λ("α");


Ver Perfil WWW
Re: Sintetizador de voz para java
« Respuesta #3 en: 25 Septiembre 2020, 12:02 pm »

Si, he hecho una prueba con el siguiente código:
Código
  1. /*
  2.  * To change this license header, choose License Headers in Project Properties.
  3.  * To change this template file, choose Tools | Templates
  4.  * and open the template in the editor.
  5.  */
  6. package sonido;
  7.  
  8. import java.util.Locale;
  9. import javax.speech.Central;
  10. import javax.speech.synthesis.Synthesizer;
  11. import javax.speech.synthesis.SynthesizerModeDesc;
  12.  
  13. /**
  14.  *
  15.  * @author pcx
  16.  */
  17. public class SonidoSp {
  18.  
  19.    /**
  20.      * @param args the command line arguments
  21.      */
  22.    public static void main(String[] args) {
  23.        // TODO code application logic here
  24.  
  25.  
  26.        try {
  27.            // Set property as Kevin Dictionary
  28.            System.setProperty(
  29.                "freetts.voices",
  30.                "com.sun.speech.freetts.en.us"
  31.                    + ".cmu_us_kal.KevinVoiceDirectory");
  32.  
  33.            // Register Engine
  34.            Central.registerEngineCentral(
  35.                "com.sun.speech.freetts"
  36.                + ".jsapi.FreeTTSEngineCentral");
  37.  
  38.            // Create a Synthesizer
  39.            Synthesizer synthesizer
  40.                = Central.createSynthesizer(
  41.                    new SynthesizerModeDesc(Locale.US));
  42.  
  43.            // Allocate synthesizer
  44.            synthesizer.allocate();
  45.  
  46.            // Resume Synthesizer
  47.            synthesizer.resume();
  48.  
  49.            // Speaks the given text
  50.            // until the queue is empty.
  51.            synthesizer.speakPlainText(
  52.                "hola esto es carnaval tu p**a madre", null);
  53.            synthesizer.waitEngineState(
  54.                Synthesizer.QUEUE_EMPTY);
  55.  
  56.            // Deallocate the Synthesizer.
  57.            synthesizer.deallocate();
  58.        }
  59.  
  60.        catch (Exception e) {
  61.            e.printStackTrace();
  62.        }
  63.  
  64.    }
  65.  
  66. }
  67.  
  68.  

Gracias su interés


[MOD] para publicar código usar las etiquetas GeSHi


No contaba con mucho tiempo pero *hay* un api version 1.0 sobre ese synthesizer que no encuentro, tambien por lo ocupado, pero creo que este ejemplo con todas las api de terceros deberia, deberia ejecutarse bien....
En línea



rubn0x52.com KNOWLEDGE  SHOULD BE FREE.
If you don't have time to read, you don't have the time (or the tools) to write, Simple as that. Stephen ki
Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  

Mensajes similares
Asunto Iniciado por Respuestas Vistas Último mensaje
Problema con audio en sintetizador de TV
Multimedia
Enemy 3 4,309 Último mensaje 10 Julio 2009, 18:32 pm
por Songoku
Que se necesita para programar en java y c++ con JNI(JAVA NATIVE INTERFACE)?
Java
hack-4-life 8 10,822 Último mensaje 5 Octubre 2010, 03:01 am
por hack-4-life
Sintetizador de texto eSpeak en python
Scripting
jabar1984 3 4,525 Último mensaje 22 Abril 2014, 00:31 am
por Gh057
Sintetizador musical
Multimedia
Kasswed 0 2,384 Último mensaje 30 Marzo 2016, 15:01 pm
por Kasswed
Interfaces de usuario en Java y mejor IDE para desarrollo en java
Java
Azazel 0 2,469 Último mensaje 30 Octubre 2017, 23:36 pm
por Azazel
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines