Quantcast
Channel: Questions in topic: "webrequest"
Viewing all articles
Browse latest Browse all 387

Android can't download the audio

$
0
0
Hi all, I write the code ,that I want to use TTS ,and it's can work on PC not Android. Why it can't work on Android ? IEnumerator DownloadTheAudio() { string url = "https://translate.google.com/translate_tts?ie=UTF-8&total=1&idx=0&textlen=32&client=tw-ob&q=cat&tl=En-gb"; using (UnityWebRequest www = UnityWebRequestMultimedia.GetAudioClip(url, AudioType.MPEG)) { yield return www.SendWebRequest(); if(www.isNetworkError || www.isHttpError) { Debug.Log(www.error); } else { AudioClip source = DownloadHandlerAudioClip.GetContent(www); _audio.clip = source; _audio.Play(); } }

Viewing all articles
Browse latest Browse all 387

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>