- Home /
Question by
dpoly · Jul 24, 2021 at 01:14 PM ·
error messageaudioclipwav
Why does this audio file cause this error, and how do I trap it?
This is the error:
Error: Cannot create FMOD::Sound instance for clip "" (FMOD error: Unsupported file or audio format. )
This is the file. It looks like any other WAV file, and plays fine in Windows Media Player.
[1]: /storage/temp/183930-drop.zip
And this is the code. No exception is raised, just an error message to the console.
using (var uwr = UnityWebRequestMultimedia.GetAudioClip(url, atype)) {
yield return uwr.SendWebRequest();
if (uwr.result != UnityWebRequest.Result.Success)
HandleError(uwr, "clip file");
else try {
var clip = DownloadHandlerAudioClip.GetContent(uwr);
oncomplete(clip);
} catch(Exception ex) {
_global.Fail($"url: {url} exception: {ex}");
}
}
Users can supply WAV files. I need to know which ones won't work, and handle them gracefully.
drop.zip
(11.8 kB)
Comment
Your answer