How I can play live radio stream m3u in Unity?
I try using:
WWW www = new WWW("http://www.someSuperStream.m3u");
AudioSource source = GetComponent<AudioSource>();
source.clip = www.GetAudioClip(false, true);
source.Play();
using:
UnityEngine.Video.VideoPlayer videoPlayer;
But its don’t work
I know that there are paid assets, but are there any free ones? Or other methods?
Thanks
Hey,
Did you found any method?
I try to do something like that, but only with files OGG, I can to play music with file from an URL on Website, but no by stream.
string Linkstreaming = “http://MYWEBSITE/MYFILE.ogg”;
IEnumerator reproduceRadio(){
UnityWebRequest musica = UnityWebRequestMultimedia.GetAudioClip(Linkstreaming, AudioType.OGGVORBIS );
((DownloadHandlerAudioClip)musica.downloadHandler).streamAudio = true;
yield return musica.SendWebRequest();
Debug.Log(musica);
if (musica.isNetworkError)
{
Debug.Log(musica.error);
}
else
{
AudioClip clip = DownloadHandlerAudioClip.GetContent(musica);
Debug.Log( clip + " length: " + clip.length );
if (clip)
{
ch_salsa.clip = clip;
ch_salsa.Play();
}
}
}
}