Mixing tracks in FLAC

Has anyone tried mixing tracks in FLAC, I did a test and a wav track was around 30MB and with flac I got it down to around 7MB I’m amazed at the storage savings I would have if I used this in all my mixes. But I understand there is overhead. I’m wondering if it’s a issue on modern computers.

See this posting, scroll down to the posts starting in Nov '20.
Use flac with Ardour sessions

Thanks for sharing.
I did also do some of my own test in ardour. I had a comparison and I noticed flac does seem to remove some very high end frequencies or something like that, definitely out of the hearing range so not a problem at all. I did this using the spectral analysis in ardour.

That would be a major problem. FLAC is, as the name suggests, lossless.
You can even compare raw bytes in a wav file after a encode/decode step to flac and back.

FLAC is a lossless format. You should be able to flac encode a file, decode the resulting flac file, and the original and decoded file will be the same.

Compress a file with flac:

$ flac 2.Big_Generator_44k.wav

flac 1.3.4
Copyright (C) 2000-2009  Josh Coalson, 2011-2016  Xiph.Org Foundation
flac comes with ABSOLUTELY NO WARRANTY.  This is free software, and you are
welcome to redistribute it under certain conditions.  Type `flac' for details.

2.Big_Generator_44k.wav: wrote 27547014 bytes, ratio=0.571

The use sndfile-cmp to compare the audio data. The program sndfile-cmp will specifically compare just the audio data in a file, and ignore any metadata differences.

$ sndfile-cmp ~/2.Big_Generator_44k.wav /tmp/2.Big_Generator_44k.flac

If the files differ sndfile-cmp will print a message, if the files are the same there is no output (same convention as diff, but without the option to print “files are the same” if there is no difference that the diff program has).

$ flac -d 2.Big_Generator_44k.flac

flac 1.3.4
Copyright (C) 2000-2009  Josh Coalson, 2011-2016  Xiph.Org Foundation
flac comes with ABSOLUTELY NO WARRANTY.  This is free software, and you are
welcome to redistribute it under certain conditions.  Type `flac' for details.

2.Big_Generator_44k.flac: done
[tmp]$ sndfile-cmp ~/2.Big_Generator_44k.wav /tmp/2.Big_Generator_44k.wav

In the case of wav files there is usually no metadata, so you can often just use diff to compare the original and decoded files:

[tmp]$ diff ~/2.Big_Generator_44k.wav /tmp/2.Big_Generator_44k.wav
[tmp]$ diff -s ~/2.Big_Generator_44k.wav /tmp/2.Big_Generator_44k.wav
Files /home/chris/2.Big_Generator_44k.wav and /tmp/2.Big_Generator_44k.wav are identical
1 Like

Here is what I was talking about, I will attach a screen shot. The dark blue is .wav and the light blue is FLAC

Also I will share from another view

The blueish top is from the wav and from the other one that area at the top is gone or very hard to see

I see you are comparing 32 bit float wav with 24 bit FLAC.
Those levels are below -144 dBFS. FLAC (like 16 or 24 bit fixed point wav) cannot represent those.

Levels this low are really just thermal noise anyway, nothing to worry about.

1 Like

So I checked it and the wav is 24 bit, both are 24 bit 48khz

So I looked into, I was using 32bit float in studio one but they are not native 32 bit float files before I was using them so maybe that has a small role in why the files are different on the export, i have tried a direct file to flac conversation before and I didn’t notice any differences in the past.

Also when using flac does it expand when in use to the size of a wav file ?

Let’s be absolutely clear. There is absolutely zero doubt that FLAC is a perfectly lossless compressed format. There is no need to check this, or wonder about it. The format has existed for more than a decade and is absolutely accepted even by the most of the bonkers audiophile community as a lossless distribution format. This is not a question to waste even the time it takes to write a post on our forums :slight_smile:

As for the “expand” question, that’s not really well defined. If you convert a FLAC file to a WAV file, the WAV file will be larger, yes, all the time, absolutely, no question. But the FLAC file itself does not “expand when in use”. And inside of a DAW like Ardour, the “expansion” is much more complex.

The main cost of using FLAC as the recording/playback format is a bit of extra CPU power required to compress/decompress it.

So if I’m only using flac to mix to only had to decode the file. Does it only re encode when saving or recording a track, or even when adding plugins.

Plugins in Ardour are always non-destructive, so until something is saved to disk there is no need to re-encode.

I was doing a test and with flac files using pitch shift is very slow compared to wav. Even with flac 0 which is the least compression. I assume it’s because of some kind of encoding. I read that flac files are optimized for decoding regardless of compression ratio, but I think it was mentioned the encode process depending on ratio can be more expensive.

When importing flac to ardour what is the ratio ardour uses, would be nice if we can choose.

Also does ardour still do that internal float with using 24 wav or even 24 bit flac files.

Other then that I have not noticed any performance issues playing and skipping fast through time line

1 Like

Yes, all internal Ardour and plugin processing is built around float. The only choice is does the float data get written to file, and only converted to integer PCM during export, or does the float data get converted to integer PCM data and written to project files.

I did some more test with flac 0 files and I noticed when zoooimg in and out of the waveform view of the session the gui is slow during the process, with wav it’s much faster, I was looking in the settings and I saw a waveform memory setting, I’m wondering if that would help with the slow performance on flac,

I have decided to just use wav files.

FLAC is an lossless codec(no more than 24bit).

Usually, you should expect FLAC to be used to transmit lossless music on the Internet, or to pack and backup your not on-going projects.

In the project, float 32 should be used as much as possible, which will save decoding time, and generally speaking, a project will not consume too much hard disk space.

So your saying when mixing I should use 32 float, generally when I import 24 bit files they will be converted to 32 bit float, but is that necessary, doesn’t ardour still use floating point internally.

I gain stage my mixes so I don’t clip my signals, i understand some of the Benefits with floating point audio like being able to recover clipped audio if it was clipped during plugin use etc.

Reason why i was considering flac to mix was storage space, on my mac I have limited un upgradable storage and hate doing dongles and external all the time. My current project is like 30GB and with flac it was go wayyy less then that and to me that’s attractive however there is some performance issues I has with mixbus 8 in regards to wave form zooming. However tried a session in studio one 5 and flac seems to run very good. So maybe it’s not optimized for ardour or mixbus. I have to try it on ardour 7 or something.

I have been using flac’s exclusively for the past 2 years(starting with Ardour 6). I mix documentaries and usually receive anywhere between 10 to 30 tracks as consolidated wave files. Some of these documentaries are 2 hours long. To reduce disk space I always convert them to flac, and import these flacs into ardour, mix them with several music and sound-effect tracks(flacs again) and export them first as flac for QC; and finally as wav for delivery.

I have never experienced any quality issue with flac.