com.rest.elevenlabs
com.rest.elevenlabs copied to clipboard
ElevenLabs download audio in WebGL Build
Bug Report
Overview
I have a problem with downloading from ElevenLabs of the audios in a WebGl build of my application, follow the browser logs is by CORS, that I can not load the audios and failure to download with Utilities.WebRequestRest. Has anyone encountered this error?
Screenshots
Please replace screenshot with error text. I can't read it.
List errors:
Cross origin requests are only supported for HTTP.
Fetch API cannot load file:///tmp/download_cache/ElevenLabs/TextToSpeech/onwK4e9ZLuTAKqWW03F9/cF3SDAlKxqH9JJIxDtRe.ogg due to access control checks.
Utilities.WebRequestRest.RestException: Failed to download audio clip from "file:///tmp/download_cache/ElevenLabs/TextToSpeech/onwK4e9ZLuTAKqWW03F9/cF3SDAlKxqH9JJIxDtRe.ogg"!
at Utilities.WebRequestRest.Rest.DownloadAudioClipAsync (System.String url, UnityEngine.AudioType audioType, System.String fileName, Utilities.WebRequestRest.RestParameters parameters, System.Threading.CancellationToken cancellationToken) [0x00000] in <00000000000000000000000000000000>:0
I think there is an additional step you must to to enable CORS for your webgl build.
But also, I think the download cache works differently on WebGL since there isn't access to local disk.
I'm looking for documentation on this but I can't find anything that works for me, do you have any idea if this is set in the player configuration?
I think it might actually be a bug with my com.utilities.rest library.
I'll do some validations and get back to you.
Yeah for now this package does not support WebGL.
There's too many places where I'm attempting to cache them and save them to disk.