- Home /
Question by
faalbane_unity · Mar 22, 2020 at 05:51 PM ·
audioaudiosourceaudioclipmp3
Play MPEG from web options
string url = "urlwithmpeg";
UnityWebRequest music = UnityWebRequestMultimedia.GetAudioClip(url, AudioType.MPEG);
yield return music.SendWebRequest();
if (music.isNetworkError)
{
Debug.Log(music.error);
}
else
{
AudioClip clip = DownloadHandlerAudioClip.GetContent(music);
Debug.Log(clip + " length: " + clip.length);
if (clip)
{
GetComponent<AudioSource>().clip = clip;
GetComponent<AudioSource>().Play();
}
}
This is throwing an error: "Streaming of 'mpeg' on this platform is not supported"
Are there any simple solutions?
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220612225513im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Playing many audioclips with PlayOneShot causes all sound to cut out. 0 Answers
Truncate audio runtime 0 Answers
AudioSource.PlayOneShot playing loud and garbled 1 Answer
audio.clip.GetData() returns no data. 0 Answers
Unity 5 low audio volume 1 Answer