Flac audio import support, it's 2017 why no flac?

Storing WAV files in a project for import seems pretty silly when we could use flac for the same lossless quality.

Flac is an open format that would be trivial to implement as an importer for Unity.

Why don’t we have it? What’s the deal?

Please hear us Unity, flac is wanted, it’s 2017, why are we using WAV for lossless?? Makes no sense at all.

There’s a feature request here: https://feedback.unity3d.com/suggestions/add-flac-audio-support please vote for it if you want flac support.

We want flac :frowning:

9 Likes

Even better would be to expose an API so we could provide any codecs we choose :slight_smile:

Any chance Unity?

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.

Note that iOS doesn’t support FLAC.

1 Like

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.

2 Likes

I gave it a bunch of votes too. FLAC can reduce file sizes anything from 20% to 80% (averaging about 30%), which is handy for shared projects.

1 Like

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).

+1 lossless unity compression for stored audio assets

2 Likes

+1

1 Like

FLAC has now reached the mainstream… but perhaps doesn’t work well with games/the current game engines.

However, WavePack (.wv) is even smaller in size and still lossless.

You can use FLAC in FMOD, but they have their FMOD Sound Bank (FSB) preferred file format or whatever

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.

+1

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).

2 Likes

My GoogleFu says flac support was added in Unity 2020.1.0

https://unity3d.com/unity/whats-new/2020.1.0

So the manual probably needs an update.

2 Likes

Documentation is still not updated?

I have a feeling that it’s wrong.

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.

I am not sure exactly what this answer means, but it seems to imply flac isn’t actually supported: How to use Unity Web request Multimedia to download FLAC audio File and convert it to audio clip?

UPDATE: I used AudioType.WAV for the flac file, and it seemed to work perfectly fine for Unity 2022.

This did not work for me