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.
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.
- TanudjaGibson-a12 hours agoCommunity Member
Thanks John so much -this is a really clear and succinct description of the process - so appreciated. I was drowning in unfamiliar terms and getting all twisted around! Onwards!
Related Content
- 8 months ago