This example shows how to set the use the generated Text-to-speech response as the source for an HTML video element
HTML:
When the OutputType is set to stream, the response is a buffer array which can be converted into a URL as below
JS:
var dataArr = new Uint8Array(bstream) // bstream is API response where OutputType is stream
var blob = new Blob([dataArr.buffer]);
var url = URL.createObjectURL(blob);
var audio = document.getElementById(โmyplayerโ);
audio.src = url
When the Output type is file, a url is returned so we can simply set it
JS:
var audio = document.getElementById(โmyplayerโ);
audio.src = url //url is API response where OutputType is file