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
- [URP] When Rendering Layers are enabled, the DepthNormalPrepass is enabled even if not used
- Shader Graph Asset icon is blurry in the 4K monitors
- Default Value of ShaderGraph Color property is 0 by default
- Duplication of an asset in the Project view is continued for some time when holding and releasing CTRL+D
- "Failed to create Convex Mesh from source mesh" PhysX errors are thrown when looking around the Scene View while Collision Geometry is set to true
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