UnityWebRequestMultimedia to get AudioClip from API

What I’m trying to accomplish sounds fairly easy. I try to download an AudioClip from our own API using an UnityWebRequestMultimedia but the AudioClip which it retrieves seems to be null all the time.

This is the IEnumerator that runs in a Coroutine to load the AudioClip:

private static IEnumerator loadAudio(DownloadJob<AudioClip> job)
{
	UnityWebRequest webRequest = UnityWebRequestMultimedia.GetAudioClip(job.URL, AudioType.MPEG);
	
	yield return webRequest.SendWebRequest();

	if (!webRequest.isNetworkError && !webRequest.isHttpError)
	{
		DownloadHandlerAudioClip dlHandler = (DownloadHandlerAudioClip)webRequest.downloadHandler;
		if(dlHandler.isDone)
		{
			AudioClip audioClip = dlHandler.audioClip;
			
			if(audioClip != null)
			{
				_audioCacheManager.Add(job.Key, audioClip);
				job.Done(audioClip);
			}
			else
			{
				job.Failed("Retrieved AudioClip is null.");
			}
		}
		else
		{
			job.Failed("The download process is not completely finished.");
		}
	}
	else
	{
		job.Failed(webRequest.error);
	}
}

I can’t spot any issues with this piece of code and I suspect that the WebRequest does not follow the API’s redirect that points it to the audio file directly even though the RedirectLimit has not been changed and should still be on the default value of 32. When the call URL is opened in the browser it’ll show an audioplayer without problems.

Any ideas?

Apparently the WebRequest did get the correct data but Unity does not allow the use of DownloadHandlerAudioClip.audioClip when the audiofile is MP3 format because of the patent ( https://feedback.unity3d.com/suggestions/streaming-mp3-support-now-that-patent-has-expired ).

To work around this I took the raw data ( DataHandlerAudioClip.data ) and used an external library to convert it to WAV data and created an AudioClip with that. ( c# - How do i play mp3 files in Unity Standalone? - Game Development Stack Exchange )

if someone still has trouble with it - just upgrade your project to unity 2020.1.14f1
I am not sure, when exactly it was fixed, but in 2020.1.14 loading clip from mp3 is not a problem.