- Home /
How to use Unity Web request Multimedia to download FLAC audio File and convert it to audio clip?
hi there! I have some audio files in FLAC format and for the sake of maintaining the audio quality I want to use FLAC audio formats the problem is unity 2020 has a support for FLAC file now but when i try to download the files using UnityWebRequestMultimedia.GetAudioClip(urlToDonwload, AudioType.OGGVORBIS); it give an error about FMOD file not supported. I tried the other formats but the audio quality gets compromised with those. so does some one know a way around this problem!? also the AudioType doesnt have an option for FLAC format when downloading audio clip from a url. HELP!
I am currently using unity 2020.3.0f1 so I had already make sure the FLAC formats are supported and playable in unity editor.
Answer by sheikh_Ati · Mar 23, 2021 at 02:04 PM
Augh!! I feel so stupid now! I was so into unity web request that I didn't even bother going with WWW web request and getting audio with www.GetAudiioClip(); So the problem with unity web request multimedia was... you have to specify the audio type where in www it get the audio type by default that means which ever audio format it may be if it is supported by unity editor then it will just made an audio clip of that type and every thing works but I wonder why unity web request didn't work for FLAC audio format! My problem is resolved but the UnityWebRequestMultiMedia.GetAudioClip, not been able to get FLAC audio still remains!
Answer by janm_unity3d · Apr 09, 2021 at 12:51 PM
Hi @sheikh_Ati, the reason for this is that FLAC is only used internally by the editors to import audio files into the much smaller subset of internal formats specified by the AudioClip's Compression Format property. As such, FLAC decoding is not built into the standalones.