Jump to content

TTS inside the game


seeh
 Share

Recommended Posts

  • 3 weeks later...
1 hour ago, Stan` said:

people should use mumble

I dream about the characters/objects(inf,worker,...) speak to their player. I have already implemented something in a mod. They are robotic voices but were generated prior to the game and saved as audio and then eventually played at a suitable moment. Unfortunately, I don't have a TTS for the mod programmer.

you probably meant that team chat messages are pronounced. idk about this (maybe useful - idk - i don't want discuss this).

Edited by seeh
Link to comment
Share on other sites

found something is pretty fast. tested in python. only works in linux i guess.

idea how i could call it from a mod ?

    # TTS works. i like it :) https://wiki.ubuntuusers.de/eSpeak/#Beispiele
    # sudo apt-get install espeak 
    espeak = 'espeak -vEN "0 A. D. "'
    import subprocess
    p2 = subprocess.Popen(espeak , shell=True)

    if True: # this notify is visible before espeak endet talking :) thats nice
        from plyer import notification
        notification.notify(
            title = espeak,
            message = espeak,
            timeout= 2,
            toast=False)

 

Link to comment
Share on other sites

this works for Linux users (tested in kUbunutu).

TTS (speaks text) for mod-developer:

in the mod use:

Engine.ConfigDB_WriteValueToFile("user", "AudioTTS.speak", "hello speak this 15", "config/user.cfg");

in the AutoKey-Script:
https://gitlab.com/-/ide/project/sl5net/0ad_tts_for_mods/tree/main/-/0ad_TTS_userCfg/

 

it reads every 0.5 seconds the modified time of your user.cfg
if changed it searches line AudioTTS.speak and speak it (its maybe the fist and it needs not search long time)

 

Edited by seeh
  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...