I doubt you’ll ever get an API, since every different platform has different audio decoding libraries written in native code. For now, have you tried encoding your FLAC into an .Ogg file? The .Ogg container supports FLAC, maybe Unity has an up to date .Ogg library that will handle FLAC playback.
I don’t think we wants to play flacs at runtime, he just wants to be able to use FLAC in his project as his lossless format that will then be converted to whatever platform appropriate format Unity will convert it to.
Threw some votes on feedback, I’d like to see flac support too.
Even with LFS support GIT repositories can grow to gargantuan sizes with WAVs. Compressed audio clips are sometimes not an option, because they end up being transcoded (with the inevitable loss of information).
It’d be great to have FLAC support and just as good to be able to control the OGG encoding settings (beyond the percentage based CBR setting).
The feedback site no longer works because they’re working on something a bit more scalable I guess? (Says in a forum post when you click on any feedback link, including the one up there ^)
I’d love .flac support too. It’s like having a high quality png, and exporting it to different platforms in different formats, you don’t use it for runtime, but you have the highest possible quality one as a starting point.
I would to love a flac option which can then be converted to whatever format is required for whichever build. Lossless and much smaller than wav when using high compression.
Good suggestion — I didn’t even know that Ogg could be a container for FLAC-encoded files. Unfortunately this doesn’t appear to work in Unity 2019.2.8. I’m seeing an error that says FSBTool Error: Failed decoding audio clip, so perhaps Unity can’t decode FLAC in the first place. +1 for this feature as well.
For anyone who wants to test this in the future, you can export wav → Ogg-FLAC in Audacity with “Custom FFmpeg Export” or by command line if you navigate to your flac.exe and type something like flac --ogg C:\MyAudioFile.wav. The output will be .oga, and you can just rename it to .ogg. You can confirm that the conversion worked by checking the codec field in Foobar or any similar program.
Using Unity 2020.1.1, it seems to be possible to use flac files (tested on Windows 10). Any official info about this? The manual doesn’t list it as a supported format (Unity - Manual: Audio files).
I am not sure what “Added support for importing .flac files” means or how to actually use it in code.
I see that AudioType still does not have “flac” as a type. I am not sure which AudioType to specify when calling UnityWebRequestMultimedia.GetAudioClip.