Forum rules - please read before posting.
Tech questions during the weekend? Drop in on the community Discord channel!

Placeholder voice audio using text-to-speech

Hi all,

I recently started using CereVoice Cloud (http://www.cereproc.com) to generate placeholder voice audio in a semi-automated way for my game project. Of course it's no substitute for real voice actors in the final game, but I personally like to have just some form of voice audio in place when building scenes - and with this approach you don't have to spend time recording and editing audio that you're just going to throw out as dialogue text changes during development.

If you register as a developer you get 10,000 text characters of audio free per month (you can buy more), which should be plenty for most adventure game projects, and they have quite a few different voices to choose from.

I wrote a Python script that takes a dialogue text file (as exported from AC) and automatically queries their cloud service for .ogg files, and saves them with the correct file names for use in AC.

If anyone out there is interested, I'd be more than happy to polish it a bit and post a link here.

Comments

  • Hi Snebjorn!

    Yes, I'm very interested in your Python script. It would be terrific to get different accents and nationalities into our temp voice audio. If you have time, I'd appreciate it!
  • edited August 2015
    Cool - will get it organised so it's usable by other people - I have a very busy weekend ahead of me here, so it probably won't happen until Monday.
  • Here's a link to the script in its current form - error handling could definitely be better, but it gets the job done. I'll write a description of  how to use it later.

    https://dl.dropboxusercontent.com/u/6457013/AdventureCreator2CereProc.py
  • Well, might as well just do it now ...

    First of all, you need to get a developer account from CereProc - instructions on their web site.

    Then set your account credentials near the top of the script, define the name of the player character (AC expects the audio files to be named "Player*" rather than the character name - the file names in the script sheet won't work) and define which CereProc voice to use for each character (voices can be tested directly on their web page) - this version of the script is set up to work with the characters from the 3D demo scene.

    Export the script sheet from AC's speech editor, then feed this text file as a command line parameter to the script, like this:

    python AdventureCreator2CereProc.py demo.txt

    Ogg files are by default downloaded to a "Speech" subdirectory, indvidual text lines are put into text files in the "Text" subdirectory. This is used to only retrieve new or updated speech lines.

    Hmmm ... that's really it. Let me know if you have any questions.
  • And this obviously requires you to have the python interpreter installed! :-)

  • Thanks! I downloaded your .py file and will experiment with it.
    Does this all need to be done in a particular folder?
  • By default it will write the audio files to a "Speech" subdirectory, so I suppose you could run it from a "Resources" folder inside a Unity project, but I just manually copy the files whenever I update dialogue text.
  • edited September 2015
    AC v.1.48 breaks this - will update the script ASAP.
  • edited September 2015
    Have updated the script to work with AC v.1.48 (and removed the original version as it doesn't work any more).

    Here's a short example - game prologue, David feeling sorry for himself, placeholder image, music by yours truly.


    Again: obviously not for production use, but gets some voice audio into the game during development almost without effort.

    Will polish and upload the new version of the script if anyone's interested.
  • edited September 2015
    Oh, just to make one thing clear: this isn't confined to cut scenes, it works with conversations too.

    Perhaps not the best example I chose for the video ...   :O)
  • Wow - that sounds significantly better than I would have expected. If you don't mind posting the script again I may give this a go.
  • No problem. Will try and get a new version online within the next couple of days.

  • Okay - the new version is up:

    I've changed a couple of things, so here's an updated set of instructions:

    First of all, you need to get a developer account from CereProc - instructions on their web site.

    Then set your account credentials near the top of the CereProcConfig script and define which CereProc voice to use for each character (voices can be tested directly on their web page).

    Export the script sheet from AC's speech editor, then feed this html file as a command line parameter to the script, like this:

    python AdventureCreator2CereProc.py demo.html

    The script then chews through the file, outputting progress like along the way.

    Wav files are by default downloaded to a "Speech" subdirectory, indvidual speech lines are put into text files in the "Text" subdirectory. This is used to only retrieve new or updated speech lines.

    After the files have been downloaded, I recommend normalizing them to a common loudness level. For these files that are only used during development, a quick solution is the normalize command line tool (http://normalize.nongnu.org/)

    Once that's done, the wav files can be copied to the Resources/Speech folder in your AC project and you should be up and running.

    Error handling in the script is almost non-existent (and remember: this is the polished version!), but it gets the job done for me - let me know if you run into any problems or have any questions! :-c
  • ... and you also need to have a working Python interpreter on your system, of course!

    Normal output during processing looks like this:

    SPEECH LINE START:
    Character: Skipper
    Filename: Skipper14
    SPEECH LINE END Text: 'Have a great stay.'
    READY TO PROCESS SPEECH LINE
    {'status': '200', 'content-length': '326', 'x-powered-by': 'PHP/5.3.29', 'server': 'nginx/1.8.0', 'connection': 'keep-alive', 'date': 'Mon, 28 Sep 2015 15:23:59 GMT', 'access-control-allow-origin': '*', 'access-control-allow-headers': 'Access-Control-Allow-Origin', 'content-type': 'text/html; charset=UTF-8'}
    <?xml version="1.0"?>
    <speakExtendedResponse>
         <charCount>31</charCount>
         <resultCode>1</resultCode>
         <resultDescription>Successful Synthesis</resultDescription>
         <metadataUrl />
    </speakExtendedResponse>
  • Looks nicely done! Really appreciate you sharing it. 
  • edited March 2016
    I took a slightly different approach by using " EasyVoice"
    Unity asset

    Does the deed.
  • Let's have a look at new text to speech version https://texttospeech.onl. This gives you unlimited and free access to use in multiple languages.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.