Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Audio Error: Cannot create FMOD...

Discussion in 'Audio & Video' started by DenVer9, Feb 20, 2018.

  1. DenVer9

    DenVer9

    Joined:
    Aug 31, 2017
    Posts:
    5
    Hello, I'm downloading music by link

    Code (CSharp):
    1. IEnumerator ChangingMusic(float delay, string typeMusic, GameObject obj)
    2.     {
    3.         yield return new WaitForSeconds(delay);
    4.  
    5.         using (UnityWebRequest www = UnityWebRequestMultimedia.GetAudioClip("https://freesound.org/people/InspectorJ/sounds/369147/download/369147__inspectorj__music-box-happy-birthday.wav", AudioType.WAV))
    6.         {
    7.             yield return www.SendWebRequest();
    8.  
    9.             if (www.isNetworkError)
    10.             {
    11.                 Debug.Log(www.error);
    12.             }
    13.             else
    14.             {
    15.                 AudioClip myClip = DownloadHandlerAudioClip.GetContent(www);
    16.                 obj.GetComponent<AudioSource>().clip = myClip;
    17.                 obj.GetComponent<AudioSource>().Play();
    18.             }
    19.         }
    20.     }
    Any format produces an error
    Platform - WebGL

    Please.
     
  2. DenVer9

    DenVer9

    Joined:
    Aug 31, 2017
    Posts:
    5
  3. Afamuefuna

    Afamuefuna

    Joined:
    Sep 6, 2019
    Posts:
    13
    Hello, I know this is pretty late but I got the same error, I solved mine by changing Audiotype to MPEG

    Code (CSharp):
    1.  using (UnityWebRequest www = UnityWebRequestMultimedia.GetAudioClip(URL, AudioType.MPEG))
    2.  
     
    The_Island likes this.