Welcome to the Oculus Developer Forums!

Your participation on the forum is subject to the Oculus Code of Conduct.

In general, please be respectful and kind. If you violate the Oculus Code of Conduct, your access to the developer forums may be revoked at the discretion of Oculus staff.

UnityWebRequestMultimedia audio not playing on Oculus Go

youjeanzyoujeanz Posts: 1
NerveGear
Hi, so we have a text-to-speech method that downloads audio from a url. This audio works perfectly fine on the "play mode" of Unity, however, when trying  to run the build on the Oculus Go, the audio from the text-to-speech doesn't seem to be playing at all. All the audios except text-to-speech seem to be doing perfectly fine on the Oculus though. Moreover, it doesn't seem to be a network error as proven through the if/else statement in the code. We're not sure if it's an issue based on formatting or just the UnityWebRequest audio handling.
Here's the part of the code that does text-to-speech (C#)
------------------------------------------------------------------------
    IEnumerator DownloadTheAudio(string speech) {
       //Debug.Log("general speak method");
       using (UnityWebRequest www = UnityWebRequestMultimedia.GetAudioClip(url, AudioType.MPEG)) {
           yield return www.Send(); 

           if (www.isNetworkError)
           {
               Debug.Log(www.error);
               yield break;
           }
           else
           {
               //_audio is declared inside the class as "public AudioSource _audio"
               AudioClip myClip = DownloadHandlerAudioClip.GetContent(www);
               _audio.clip = myClip;
               _audio.Play();
           }
       }

   }
-------------------------------------------------------------------
And here's a sample method that would run that script vvv
-------------------------------------------------------------------
    public void Greet() {
        string person = "Bob";
        string speech = "Nice to meet you " + person;
        StartCoroutine(DownloadTheAudio(speech));
    }
--------------------------------------------------------------------
Sign In or Register to comment.