Demo Llais Synthetig Cymraeg / Welsh Synthetic Language Demo

HTML5 <audio>

"Mae hyn yn llais synthetig Cymraeg sydd wedi ei greu gan Prifysgol Bangor"

Cod /Code:

<audio controls> <source src="https://api.techiaith.org/festival/v1?api_key=7e1136b1-c33b-4e84-a87e-0a0a4ee08cd3&text=Mae%20hyn%20yn%20llais%20synthetig%20Cymraeg%20sydd%20wedi%20ei%20greu%20gan%20Prifysgol%20Bangor" type="audio/ogg"> Your browser does not support the audio element. </audio>

Autoplay

Mae'r sain yn cael ei chwarae'n syth / the audio is autoplayed

"Dyma llais synthetig Cymraeg sy'n cael ei chwarae'n awtomatig"

Cod / Code

<audio controls autoplay> <source src="https://api.techiaith.org/festival/v1?api_key=7e1136b1-c33b-4e84-a87e-0a0a4ee08cd3&text=Dyma%llais%20synthetig%20Cymraeg%20sy'n%20cael%20ei%20chwarae'n%20awtomatig" type="audio/ogg"> Your browser does not support the audio element. </audio>

Cyflymu neu Arafu'r Llais / Speed up or slow down the voice

Mae modd cyflymu neu arafu'r llais gyda'r paramedr 'stretch'. Mae rhif llai nag 1 yn cyflymu'r llais (e.e. 0.5 yn dyblu'r cyflymder) a rhif mwy nag 1 yn arafu'r llais (e.e. 2 yn haneru'r cyflymder).

It's possible to speed up or slow down the voice using the 'stretch' parameter. A number less than 1 speeds up the voice (e.g. 0.5 doubles the speed) and a number greater than 1 slows down the voice (e.g. 2 halves the speed)

"Rydw i'n siarad Cymraeg yn gyflym iawn iawn!"

Cod / Code:

<audio controls> <source src="https://api.techiaith.org/festival/v1?api_key=7e1136b1-c33b-4e84-a87e-0a0a4ee08cd3&text=Rydw%20i'n%20siarad%20Cymraeg%20yn%20gyflym%20iawn%20iawn&stretch=0.6" type="audio/ogg"> Your browser does not support the audio element. </audio>

Lais Cymraeg trwy Javascript / Welsh voice through Javascript

Cod / Code:

<textarea id='llais'> Ysgrifennwch rhywbeth i'w llefaru </textarea> <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> <button onclick="llefaru()">Chwarae / Play</button> </p>