FMOD error: Unsupported file or audio format when setting AuioSource.clip
Goal I am trying to load a local .ogg file into AudioClip to play it back. However, I keep receiving an FMOD error.
The code I am using
private IEnumerator getAudio(string path) {
using (UnityWebRequest www = UnityWebRequestMultimedia.GetAudioClip(path, AudioType.OGGVORBIS))
{
yield return www.SendWebRequest();
if (www.isHttpError || www.isNetworkError)
{
Debug.Log(www.error);
}
else
{
Debug.Log("Is done? " + www.isDone);
goAudioSource.clip = DownloadHandlerAudioClip.GetContent(www);
goAudioSource.Play();
}
}
}
The error message
Error: Cannot create FMOD::Sound instance for clip "" (FMOD error: Unsupported file or audio format. ) UnityEngine.Networking.DownloadHandlerAudioClip:GetContent(UnityWebRequest)
I already:
Made sure that the .ogg file I am using found via 'path' is a legit .ogg and can be played back
Tried to add "file://" before the path
Made sure that the www has finished downloading before accessing it
Any ideas what might be my problem here?
I am using Unity 2020.1.4f1.
Answer by Afamuefuna · Feb 27 at 03:15 AM
Hello, I know this is pretty late but I got the same error, I solved mine by changing Audiotype to MPEG
Your answer
Follow this Question
Related Questions
Is there a way to convert an Audioclip to Raw Data or Grab an audio file's metadata" 0 Answers
How to make an editor extension to unity ui for switching audio clips? 0 Answers
WWW.GetAudioClip not working, throwing empty exception 2 Answers
Continuously setting the next bytes for a playing audioclip? 0 Answers