Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| marytts [2016/02/19 00:08] – created mai | marytts [2017/03/31 09:41] (current) – tag mai | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== Mary Text-To-Speech ====== | ||
| + | {{tag> software poppy project poppy-kine}} | ||
| + | |||
| + | MaryTTS is an open-source text to speech system: http:// | ||
| + | |||
| + | The main output of this project is a java program PGI_I15.jar. We have developed an API so for Poppy in the [[poppy-kine: | ||
| + | |||
| + | ===== Utilisation de MaryTTS et téléchargement de nouvelles voix ===== | ||
| + | |||
| + | Trois programmes pour linux et windows sont fournis directement après le téléchargement de MaryTTS dans le dossier « bin » : | ||
| + | |||
| + | • Marytts-server | ||
| + | |||
| + | • Marytts-client | ||
| + | |||
| + | • Marytts-component-installer | ||
| + | |||
| + | |||
| + | Le premier programme permet de lancer un serveur MaryTTS sur une machine. C’est ce programme qui sera utilisé par la suite. | ||
| + | |||
| + | Le second est un client basque qui permet via une interface graphique de tester MaryTTS. | ||
| + | |||
| + | Le troisième permet de télécharger des nouvelles voix pour le serveur MaryTTS. Il se présente sous la forme suivante : | ||
| + | |||
| + | |||
| + | {{ :: | ||
| + | |||
| + | On peut donc très facilement installer ou désinstaller des voix pour le serveur. Elle seront sauvegardées dans le dossier « installed » et dans le dossier « lib ». | ||
| + | |||
| + | Les voix que nous avons utilisées sont : | ||
| + | FR : // | ||
| + | EN-US : // | ||
| + | |||
| + | ===== Utilisation via Java ===== | ||
| + | |||
| + | |||
| + | Pour utiliser MaryTTS via un programme en Java, deux méthode sont possible : | ||
| + | |||
| + | • Créer une interface de type « MaryInterface » | ||
| + | |||
| + | • Utiliser une requête HTTP comme pour WebService | ||
| + | |||
| + | Il est donc possible d’utiliser MaryTTS via n’importe quel langage car il sera toujours possible d’utiliser la méthode qui utilise une requête HTTP. Ici, seule la méthode qui utilise l’interface « MaryInterface » sera développée. | ||
| + | |||
| + | Ci-dessous, quelques exemple de méthode de l’interface MaryInterface : | ||
| + | |||
| + | <code java> | ||
| + | /* création de l' | ||
| + | String host=" | ||
| + | int port = 59125; | ||
| + | MaryInterface marytts = new RemoteMaryInterface(host, | ||
| + | |||
| + | /* retourne un String contenant la liste des voix disponible en anglais US */ | ||
| + | String languesDispo = marytts.getAvailableVoices(Locale.US) | ||
| + | |||
| + | /* Selectionner la première voix disponible dans une langue */ | ||
| + | String country=" | ||
| + | Set< | ||
| + | marytts.setVoice(voices.iterator().next()); | ||
| + | |||
| + | /* Afficher la voix selectionnée */ | ||
| + | System.out.println(" | ||
| + | |||
| + | /* Demander au serveur de générer un fichier audio */ | ||
| + | String sentence = ("Ceci est une phrase de test" | ||
| + | AudioInputStream audio = marytts.generateAudio(sentence); | ||
| + | |||
| + | /* Lire le fichier audio */ | ||
| + | AudioPlayer player = new AudioPlayer(audio); | ||
| + | player.start(); | ||
| + | player.join(); | ||
| + | </ | ||
| + | |||
| + | |||
| + | ===== Utilisation de l'API du projet: ===== | ||
| + | |||
| + | ==== The Java API ==== | ||
| + | |||
| + | |||
| + | Usage: | ||
| + | |||
| + | java example.MaryTTSEmbedded [country part side position] [--help] [-p your_personnal_tts_string country] | ||
| + | |||
| + | ARGUMENTS : | ||
| + | country : en | fr (natively supported) | ||
| + | part : arm | hand | elbow | shoulder | leg | foot | knee | hip | ||
| + | side : left | right | 0 | ||
| + | position : up | down | front | back | left | right | ||
| + | |||
| + | OPTIONS : | ||
| + | -p string country : Use your personal TTS string | ||
| + | |||
| + | ==== The python API==== | ||
| + | |||
| + | python client-mary.py [country part side position] | ||
| + | |||
| + | ARGUMENTS : | ||
| + | country : en | fr (natively supported) | ||
| + | part : arm | hand | elbow | shoulder | leg | foot | knee | hip | ||
| + | side : left | right | 0 | ||
| + | position : up | down | front | back | left | right | ||
| + | |||
| + | ==== How to install ==== | ||
| + | |||
| + | * You need to have the .jar and the python program from {{: | ||
| + | * Download MaryTTS from https:// | ||
| + | * install Maven from http:// | ||
| + | * Compile the MARY system itself from the folder mary-master where you downloaded the MaryTTS code, with command < | ||
| + | |||
| + | |||
| + | |||
| + | ==== Step to step : running the python program ==== | ||
| + | |||
| + | - In folder marytts-master/ | ||
| + | - In the folder where you downloaded | ||
| + | - in folder where you downloaded {{: | ||