Search Unity

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

Discussion in 'Editor & General Support' started by larku, May 11, 2017.

  1. larku

    larku

    Joined:
    Mar 14, 2013
    Posts:
    1,412
    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 :(
     
    Last edited: Jul 17, 2017
    _eternal, Stexe, hippocoder and 4 others like this.
  2. larku

    larku

    Joined:
    Mar 14, 2013
    Posts:
    1,412
    Even better would be to expose an API so we could provide any codecs we choose :)

    Any chance Unity?
     
  3. Dreamwriter

    Dreamwriter

    Joined:
    Jul 22, 2011
    Posts:
    472
    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.
     
    _eternal likes this.
  4. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    6,440
    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.
     
    nco2k and larku like this.
  5. orb

    orb

    Joined:
    Nov 24, 2010
    Posts:
    2,960
    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.
     
    larku likes this.
  6. Silktrader

    Silktrader

    Joined:
    Aug 27, 2014
    Posts:
    8
    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).
     
  7. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    26,434
    +1 lossless unity compression for stored audio assets
     
    CyRaid likes this.
  8. emkusa

    emkusa

    Joined:
    Sep 16, 2016
    Posts:
    2
    +1
     
    CyRaid likes this.
  9. seanguy2

    seanguy2

    Joined:
    May 3, 2019
    Posts:
    1
    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
     
    Last edited: May 21, 2019
  10. CyRaid

    CyRaid

    Joined:
    Mar 31, 2015
    Posts:
    86
    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.
     
  11. I5bit

    I5bit

    Joined:
    Aug 26, 2017
    Posts:
    1
    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.
     
  12. Hyp-X

    Hyp-X

    Joined:
    Jun 24, 2015
    Posts:
    233
  13. _eternal

    _eternal

    Joined:
    Nov 25, 2014
    Posts:
    116
    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.
     
unityunity