For a narrative-driven game like Arctic Awakening, it's really important for our team at GoldFire Studios to be able to quickly get a feel for the flow and pacing of a scene. We do this some time before we actually head into the recording studio with our voice actors, so we need some kind of placeholder to fill in for the real recorded dialogue.
Developers have a few options for placeholder dialogue, including timed subtitles and scratch audio recorded by programmers (the aural equivalent of "programmer art"). We tried both of these early on in development for Arctic Awakening before settling on a workflow using Google Cloud Speech, which has proved a significant time saver and given great results. Better still, our use case has fit within the product's free tier.
The Text-to-Speech product is a Cloud API which delivers great-sounding voice clips from the text strings you provide. You can pass other options besides the content itself, specifying a language, one of several presets for the character of the voice, and a gender. The language code allows for different accents as well, for instance American, British, Indian or Australian English.
We already had a database with the data we needed to get started (the line itself and the character who said it), so plugging that into Google's API was relatively quick and painless. Here's a snippet of our code in our dialogue management platform, StoryDB (which we'll talk more about in a later post):
And here's a sample of what gets generated:
From there, we jump into our game engine (Unity) and run a script which automates importing the line metadata and the audio clips. At that point, the clips themselves as well as the subtitles are ready to be used in a scene!
We're really happy with the results, and we'd definitely encourage other developers to give it a try if it sounds useful for your projects. If you have any questions, please drop a comment below and we'll be happy to answer to the best of our ability. We'll also be covering StoryDB in more detail in a future post.