Need help playing .aac file from live audio stream

Okay, long story short, I am experimenting with playing audio steams from the internet in Unity. Specifically, I am interested in using public radio web broadcasts.

I managed to send a UnityWebRequestMultimedia (with AudioType AUDIOQUEUE) and get back the .aac audio file. However, this audio cannot be played in an AudioSource object. The error I am getting says that it is not a supported audio format.

So, I started looking into ways to convert this file to WAV or MP3 or something I know Unity can handle. There are a few Codecs from Windows that can convert it, but I honestly have no clue how to bring them into Unity.

Anyone got an idea on where I can go with this? I have the audio file, but no clue how to play it.

I think your best shot for a simple integration is using NAudio (GitHub - naudio/NAudio: Audio and MIDI library for .NET) to convert the file or directly access its samples. It’s a great C# audio library.