Forum Discussion
Converting user text field entries to real-time text-to-speech dialogue in Storyline 360?
- 2 days ago
Great question! Real-time text to speech conversion is, indeed, pretty straightforward. ElevenLabs has a 'Developers' section on their site with code samples of how to do it. BUT - and here's the rub - to pass the text over to the Eleven Labs Voice Generator you need to include the API Key in the request. If you do that from a JavaScript code script in Storyline you will expose the API Key - once someone has that key, they can call ElevenLabs services and you will be charged.
To overcome this you need to create a small app that calls ElevenLabs and put it on a server (or use a serverless function). This app can then hold the key in an environment variable (i.e. it reads it from a secure file). Your Storyline JavaScript would then call the server app which, in turn, calls ElevenLabs and then forwards (or streams) audio back to the Storyline client app.
I know that sounds complicated - but it isn't too bad if you have access to a server.
I should add - I use this client/server method myself when creating adventure games in Storyline. I might use a range of different voices in the game - so to speed up the process I have created a simple client app:
The server app can handle requests for voices from ElevenLabs or Azure Voice Services. I could use ElevenLabs Studio but I find this app just saves time once I have chosen the voices.
- TanudjaGibson-a12 hours agoCommunity Member
Yes we've just seen ElevenLabs Studio - need to explore and find out what it does and what our subscription covers. Thanks for the added information. This is a bit (ok a lot) out of my expertise and ability - not a developer in any way, shape or form, not even JavaScript, but I'm going to give it all a try. Now that I understand what needs to happen I think I can get ChatGPT to walk me through it.
Related Content
- 8 months ago