Text-to-Speech API
The text-to-speech API service allows you to add a Welsh synthetic voice into your code, apps and websites. It and on websites. It’s easy to use, and it’s free.
Here, for example, is how to use the API within an HTML web page:
<br /><!-Dechrau Testun i Leferydd / Start Text to Speech -------------------------------></p> <p> </p> <p> <script type="text/javascript"> function llefaru() { var testun = document.getElementById('llais').value.trim(); var audioElement = document.createElement('audio'); var url = "https://api.techiaith.org/festival/v1?api_key=7e1136b1-c33b-4e84-a87e-0a0a4ee08cd3&text=" + encodeURI(testun); audioElement.setAttribute('src', url); audioElement.play(); } </script> </p> <p><button>Chwarae / Play</button></p> <p><!-Diwedd Testun i Leferydd / End Text to Speech ----------------------------------><br />
Go to our API Services in order to register and receive your personal API key in order to use this service. Here is the guide on how to get an API key.
For more specific information on how to use the service, and example code, follow the link below to the Festival text to speech API page on GitHub :