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

Passing runtime configuration settings indirectly #223

Closed Victor-Almeida closed 5 years ago

Victor-Almeida commented 5 years ago

Hello.

I've been trying to use Nuance as tts, but it doesn't seem to work. I'm using Jupyter Notebook and can't pass the -r="tts=nuance|tts_cache=True|allow_unlisted_languages=True" parameter directly, so I tried the following :

This was my first attempt :

from aeneas.executetask import ExecuteTask
from aeneas.task import Task

config_string = u"task_language=jpn|is_text_type=plain|os_task_file_format=json"
task = Task(config_string=config_string)
task.audio_file_path_absolute = "../Natsume Souseki - Meian/meian/meian_0000.wav"
task.text_file_path_absolute = "../Natsume Souseki - Meian/meian_0000.txt"
task.sync_map_file_path_absolute = "./syncmap.json"
task.rconf = u"tts=nuance|tts_cache=True|allow_unlisted_languages=True"

ExecuteTask(task).execute()

task.output_sync_map_file()

And this was my second attempt :

from aeneas.tools.execute_task import ExecuteTaskCLI

ExecuteTaskCLI(use_sys=True).run(arguments=[
    None, # dummy program name argument
    u"../Natsume Souseki - Meian/meian/meian_0000.wav",
    u"../Natsume Souseki - Meian/meian_0000.txt",
    u"task_language=jpn|is_text_type=plain|os_task_file_format=json",
    u"./syncmap.json",
    u"tts=nuance|tts_cache=True|allow_unlisted_languages=True"
])

Both attempts raised this error : ExecuteTaskExecutionError: Unexpected error while executing task : Language 'jpn' is not supported by the selected TTS engine

What am I doing wrong?

readbeyond commented 5 years ago

Hi,

the problem is that:

[DEBU] NuanceTTSWrapper: Status code: 401 [WARN] NuanceTTSWrapper: Got status code other than 200, retry [CRIT] NuanceTTSWrapper: All API requests returned status code != 200

i.e. the calls to the Nuance TTS API respond with an error message, probably because you did not specify your Nuance Developer API ID and API Key. See:

https://www.readbeyond.it/aeneas/docs/nuancettswrapper.html

for details.

readbeyond commented 5 years ago

Hi,

if you use aeneas programmatically, task.rconf is not a string, like the one you were trying to use:

task.rconf = u"tts=nuance|tts_cache=True|allow_unlisted_languages=True"

but rather it is an instance of the class RuntimeConfiguration. See:

https://www.readbeyond.it/aeneas/docs/libtutorial.html#concepts

for an example.

Moreover, as I already replied to the other post, if you want to use the Nuance TTS wrapper, you need to specify your Nuance API Key and API ID.