readbeyond / aeneas

aeneas is a Python/C library and a set of tools to automagically synchronize audio and text (aka forced alignment)
http://www.readbeyond.it/aeneas/
GNU Affero General Public License v3.0
2.45k stars 218 forks source link

Trying to get it to work with espeak-ng and arabic #214

Closed francoishernandez closed 5 years ago

francoishernandez commented 5 years ago

Hi, I'm trying to get some alignments for Arabic using the espeak-ng TTS wrapper. I installed espeak-ng, the binary is callable from any shell, three voices are available for Arabic. I tested it on a text file and it works. But, when trying to use aeneas, I'm stuck. Here's my command line:

python -m aeneas.tools.execute_task \
    test/video.wav \
    test/plain_text.segmented \
    "task_language=ara|os_task_file_format=json|is_text_type=plain" \
    test/aligned.json \
    -r="tts=espeak-ng"

But the logs still tell me arabic is not supported:

[INFO] Validating config string (specify --skip-validator to bypass)...
[INFO] Validating config string... done
[INFO] Creating task...
[INFO] Creating task... done
[INFO] Executing task...
[ERRO] An unexpected error occurred while executing the task:
[ERRO] Unexpected error while executing task : Language 'ara' is not supported by the selected TTS engine

What am I doing wrong? Thanks! F

readbeyond commented 5 years ago

Hi,

if you are using aeneas v1.7.3 (the latest release available), "ara" is not listed among the languages supported by "espeak" or "espeak-ng" TTS wrappers --- I guess Arabic is a somewhat recent addition to espeak-ng --- so when you select the "espeak-ng" TTS, aeneas checks whether "ara" is listed among the languages supported by that TTS, and not finding it, errors out.

(Note that "Arabic" is supported by the "nuance" and "macos" TTS wrappers in aeneas 1.7.3: that explains why Arabic is listed among the languages supported by aeneas 1.7.3.)

Since I foresaw the possibility that a given TTS could add new languages over time, I added the "allow_unlisted_languages" runtime configuration option: if you specify it, aeneas will not check that the language you specify is actually supported by the TTS wrapper. So, in your case:

-r "tts=espeak-ng|allow_unlisted_languages=True"

should allow you to call espeak-ng with Arabic. Note that you need to specify "task_language=ar" instead of "task_language=ara" when using the "allow_unlisted_languages" option, because the language code ("ar") will be passed as the voice name, without being converted by the aeneas TTS wrapper, and eSpeak-ng expects two-letters voice names.

I will update the list of languages/voices supported by espeak/espeak-ng in the next version of aeneas.

HTH,

Alberto Pettarin

On 10/02/2018 07:16 PM, François Hernandez wrote:

Hi, I'm trying to get some alignments for Arabic using the |espeak-ng| TTS wrapper. I installed |espeak-ng|, the binary is callable from any shell, three voices are available for Arabic. I tested it on a text file and it works. But, when trying to use aeneas, I'm stuck. Here's my command line:

|python -m aeneas.tools.execute_task \ test/video.wav \ test/plain_text.segmented \ "task_language=ara|os_task_file_format=json|is_text_type=plain" \ test/aligned.json \ -r="tts=espeak-ng" |

But the logs still tell me arabic is not supported:

|[INFO] Validating config string (specify --skip-validator to bypass)... [INFO] Validating config string... done [INFO] Creating task... [INFO] Creating task... done [INFO] Executing task... [ERRO] An unexpected error occurred while executing the task: [ERRO] Unexpected error while executing task : Language 'ara' is not supported by the selected TTS engine |

What am I doing wrong? Thanks! F

francoishernandez commented 5 years ago

Hi Alberto, This seems to do the trick, thanks a lot! François

ApayRus commented 1 year ago

@francoishernandez Hi. I did the subs in such way. But they aren't correct. What about you? Maybe you have found a better solution?