audacity 2.0.3 & flac 1.3.0

hello there,

i wonder if it is possible to use the “new” flac 1.3.0 library when exporting audio?


If we have time, the release after next (2.0.5) will update the version of libflac we use.

Until then probably the easiest solution is to use Audacity’s command-line exporter and point the command to your libflac executable. See Audacity Manual .


thank you for the info.

actually i overlooked this entry in the export dialog, it is so well hidden.

could you help me with the parameters, this is what i entered in the command box but it doesnt work.

d:codecsflac 64bitflac.exe - -6 “%f”

ps: is there reasons for hardcoding codecs in audacity by default? i believe pointing to an exe file would make things much easier.

The first part of the command needs to be the “command” (as if you were using it as a command line program), not the file name.
So it should be something like:

flac - -o "%f"

I’m on Linux so the Windows command may be slightly different.
See here for Flac documentation: FLAC - FLAC command line tool

  1. In most cases the encoding is quicker when hard coded rather than piping.
  2. It saves users from having to work out the correct syntax for the encoder they are using (we would not be able to use presets because we would not know which version of what encoder they were using).
  3. It would be a support nightmare with lots of users asking “what command do I need to export with codec xyz - this is what i entered in the command box but it doesnt work”. :wink:
  4. Most users just want to select the format and export rather than worry about command line switches.
    So we link to open source, cross-platform file writing libraries (where possible) that can be shipped with Audacity, and for formats where there may be licensing or copyright issues we provide linking to external libraries (LAME and FFMpeg) and a command line export option.

I’m surprised that works on Windows. It does for me, but I suspect only because I used a FLAC installer that placed the flac executable in Program Files. If you just got a flac.exe from somewhere and wrote Steve’s command it would never work because Audacity would have no idea where the executable was.

The general advice remains - unless you’re using lame and ffmpeg commands and have used the Audacity installer for those libraries, click “Browse…” in the “Specify Command Line Encoder” dialogue then select and open the executable you want to use. This should write the correct path to the executable (in quotes), then you can add the command parameters you want after the path.

For example

"C:Downloadsflac.exe" - -o "%f"


That’s somewhat true but nonetheless providing an interface for common command-line encoders/decoders so that users could choose the exact version of the executable they wanted would have many benefits.

That fact we don’t have that feature is the exact reason why Audacity’s FFmpeg support using an interface (dynamically loading libraries from Preferences) is stuck at 0.8 for Linux and 0.6.2 for Windows and Mac - the code changes needed to Audacity for just about every new FFmpeg version are just too much work. That work is largely gone once you write the interface.

I’ve seen arguments that we could not get a progress dialogue from an interface to a command-line encoder/decoder but I don’t know if that is a proven argument.


It should work provided that the path to the executable is defined in the environmental variables. “Installing” an encoder will usually do that. Simply downloading or unzipping an encoder will not.

Thanks for the clarification.

A useful tip for any Linux users reading this - you can check if a particular encoder can be found by the system by typing in a terminal window “which ”
For example:

which flac

If the encoder is found, this will return the path to the executable, for example:


This can be used directly, or since the system is able to find the encoder, you can just use the command.
If the path is used and the path contains any spaces it must be quoted, for example:


(on Linux, the quotes are not essential unless the path includes spaces, but it is good practice to include the quotes).
To save having to add the file extension manually in the file name, it can be added to the command, for example:

"/usr/bin/flac" - -o "%f.flac"

I don’t know how much of this will apply on platforms other than Linux (probably most of it on Mac OS X).

ok, works like charm now, thanks a lot.

well in fact, i was thinking of foobar, which would ask you only one time for the location of a codec and has preconfigured parameters. when there is a new version of a codec avaiable, you only have to exchange the exe and youre fine.

Yes and I see there is a progress bar on the file “conversion”. I can add your vote for this (unless you don’t want to) - we take “votes” into account when adding features.


What happens if the command line switches change between codec versions?

Quoting doesn’t seem to be essential on Windows 7 when the path includes spaces, but I expect it is on earlier versions of Windows and/or FAT32. It’s best practice to quote.

That works on Windows 7. :sunglasses: Assuming it works on Mac I could add it to the Manual after 2.0.4 is released.


Then you have to take it into account. But that won’t happen often for common parameters that would be expected in an interface.


i have been using foobar for many years and to be honest i would only ever exchange the exes of my favoured codecs flac and vorbis. that is why i was a little irritated by parameters all of the sudden :smiley:. correct me if im wrong, i dont think the command lines for these two ever changed since years?

i can confirm that “d:codecsflac 64bitflac.exe” - -o “%f.flac” works on win8 64bit without problems (quoting of “%f.flac” is essential).

yes, please count me in. maybe you could also start a poll about it, so probably more people have a chance to vote.

There have been some additions to the command line options for FLAC 1.3.0 (26-May-2013), but I’m not aware of any that “break” when updating from 1.2.1
–sector-align is deprecated, (but should still work for now).
–sector-align is deprecated, (but should still work for now).
And then there are some new option:

There have been some additions to the command line options for FLAC 1.3.0 (26-May-2013), but I’m not aware of any that “break” when updating from 1.2.1

thanks for the ‘changelog’. of course i was referring to changes that would break common options and possible problems when keeping flac.exe up to date.