Forum Discussion

TanudjaGibson-a's avatar
TanudjaGibson-a
Community Member
2 days ago
Solved

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 b...
  • JohnCooper-be3c's avatar
    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.