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)
-
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
- Articulation Body with 'Revolute' Joint Type has erratic behavior when Upper Limit is set to above 360
- WebGL Player fails to render Scene when Terrain with Detail Mesh is added and WebGPU Graphics API is used
- Inconsistent errors are logged when different types are passed into the Query "Q<>" method in UIToolkit and the ancestor VisualElement is null
- Crash on GetMaterialPropertyByIndex when opening a specific Scene
- Discrepancies in the styling are present when using a TSS file instead of a USS file in custom EditorWindow
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