Forum Discussion

TanudjaGibson-a's avatar
TanudjaGibson-a
Community Member
19 hours ago

Converting user text field entries to real-time text-to-speech dialogue in Storyline 360?

Hi. In our online courses built in Storyline 360 and hosted on an LMS, we'd like our users to use 1 text field to type in a 2-person conversation between them and their client. Then we want them to be able to "press a button, click an object, click NEXT etc  i.e. do something" that will enable the conversation to be read back to them, verbatim, by 2 AI voices. So the conversations are real-time - we aren't providing made up scenarios - we want the user to make up the content and then hear back what the conversation would sound like, as a learning tool/fun interaction. ChatGPT has suggested it could be done using web objects but I'm wondering if anyone else has done it and would be willing to share how - saves reinventing the wheel. We have an ElevenLabs subscription and can get ChatGPT to do the JavaScript for us. Many thanks 

2 Replies

  • 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.