Search Issue Tracker
Fixed in 2021.1.X
Fixed in 2018.4.X, 2019.4.X, 2020.1.X, 2020.2.X
Votes
2
Found in
2018.4
2019.3.15f1
2019.4
2020.1
2020.2
Issue ID
1252868
Regression
No
Platform not supported error is thrown when trying to play an MP3 file in editor with build platform set to WebGL
Reproduction steps:
1. Open attached project "1252868"
2. Open scene "SampleScene"
3. make sure WebGL is set as the build platform
4. Enter Play Mode
Expected result: Audio is played
Actual result: Platform not supported error is thrown
Reproducible with: 2018.4.23f1, 2019.4.0f1, 2020.1.0b13, 2020.2.0a15
Note: Issue is not reproducible in a built game
Full error:
Streaming of 'mpeg' on this platform is not supported
UnityEngine.Networking.DownloadHandlerAudioClip:GetContent (UnityEngine.Networking.UnityWebRequest)
AudioRequest/<SendGetAudio>d__1:MoveNext () (at Assets/Scripts/WebFileRequest.cs:44)
UnityEngine.SetupCoroutine:InvokeMoveNext (System.Collections.IEnumerator,intptr)
Comments (1)
-
iscf
Jul 09, 2020 08:19
Use this slution in Editor : https://answers.unity.com/questions/737002/wav-byte-to-audioclip.html
No problem in build so here the code i use :
```
public class AudioRequest
{
public AudioClip audioClip = null;public IEnumerator SendGetAudio(string url)
{
//Due to bug in Editor MP3 not supportedusing (UnityWebRequest www = UnityWebRequestMultimedia.GetAudioClip(url, AudioType.MPEG))
{
yield return www.SendWebRequest();if (www.isNetworkError || www.isHttpError)
{
throw new Exception(www.error + "\n>>" + url);
}
else
{
#if UNITY_EDITOR
audioClip = NAudioPlayer.FromMp3Data(www.downloadHandler.data);
#else
audioClip = DownloadHandlerAudioClip.GetContent(www);
#endif
}
}
}
}
```
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- [URP] Searchable context menu instantly closes when attempting to open it
- [Multiplayer Center] Hosting Model Doesn't Reset to Recommended When Re-selecting Default Netcode Solution
- Clear Dynamic Data On Build does not clear data after a Clean Build when the Atlas Population Mode is set to "Dynamic" or "Dynamic OS"
- ACES Tonemapping causes banding artifacts and negative values in ColorGradingLUT when HDR is enabled and "High Dynamic Range" Grading mode is selected while Android Platform is used
- Android Player freezes when an Audio Source is playing and an incoming call is picked up and then hung up and the Audio Source is started again
Resolution Note (fix version 2021.1):
Fixed in 2021.1.0a3
Resolution Note (fix version 2020.2):
Fixed in 2020.2.0b10
Resolution Note (fix version 2020.1):
Fixed in 2020.1.12f1
Resolution Note (fix version 2019.4):
Fixed in 2019.4.15f1
Resolution Note (fix version 2018.4):
Fixed in 2018.4.29f1