FLAC / WAV to CD?
October 2, 2016 4:49 AM   Subscribe

I have a drive full of albums in FLAC and WAV and would like to get some of them onto CD for listening in my ancient car. I'm looking for the sweet spot for doing this with ease and w/out a huge loss of fidelity*.

I have access to Windows and Ubuntu machines.

* I'm NOT interested in debating the reality or unreality of differences in digital audio quality here.
posted by ryanshepard to Computers & Internet (7 answers total) 2 users marked this as a favorite
 
Well the files on cd ARE wav. Do you have a cd burner on your computer? If not you'll need one. CDburnerXp is free, good software to actually make the discs. Not sure where there would be any concern about loss of fidelity....
posted by chasles at 5:15 AM on October 2, 2016


Best answer: Well the files on cd ARE wav.

Aye, but WAV (or FLAC) is not necessarily 16bit 44.1kHz stereo.

The quick answer is to download Audacity for your favourite OS, import all the things, and then burn the CDs. Audacity burning guide.
posted by pompomtom at 5:43 AM on October 2, 2016


Best answer: If that were my task, I'd use a tiny script based on ffmpeg to do any necessary pre-burning format conversion in bulk, rather than relying on clickery dickery in something like Audacity. Audacity is fine and useful software, but using anything GUI-based for repetitive bulk jobs is just painful.

To convert a single file from pretty much anything with audio in it to stereo 16 bit linear PCM with a 44.1kHz sample rate in WAV format, suitable as input for any music CD burning tool, the ffmpeg command would be

ffmpeg -i input-file -vn -ac 2 -ar 44100 output-file.wav

If the input file is in a lossless format like WAV or FLAC and is already coded in 16-bit 44.1kHz stereo, the output of this will just be uncompressed audio with no quality loss whatsoever. The only way ffmpeg will actually alter the information from a losslessly encoded input file is if it needs to change the sample rate, and it does a good job of that; you'll end up with as much quality as 16 bit 44.1kHz audio allows, which is enough.

If you embed that ffmpeg command inside a shell script (for Ubuntu) or cmd script (for Windows), you can arrange for it to accept multiple input files via drag-and-drop from your file manager and produce a separate output file for each one.

Here's a Windows script:

set ffmpeg="C:\Program Files\ffmpeg\ffmpeg.exe"
for %%F in %* do %ffmpeg% -i "%%~F" -vn -ac 2 -ar 44100 "%~dp0%%~nF.wav"

Change the set ffmpeg= command in the first line so it has the full pathname to wherever you put the ffmpeg.exe executable (it comes packaged in a zip file rather than as a fullblown Windows installer, so you can put it wherever you like).

If you save that script as make-wavs.cmd and put it in a folder, then select a bunch of source files in some other folder, then drag that selection and drop it onto make-wavs.cmd, it will create (in its own folder) a bunch of .wav files formatted correctly for burning to an audio CD as audio tracks. Use your favorite audio CD burning software to burn them (I like InfraRecorder for this step on Windows), delete all the .wavs when the burn is done, repeat for each album.

The script works as follows: when you use Windows Explorer to drag and drop a bunch of files onto make-wavs.cmd, Explorer launches the script and hands it all those files' pathnames as a list of arguments.

%* means "all the arguments", and for %%F in %* do invokes the ffmpeg command that follows once for each of those, with the variable %%F set to the particular pathname involved each time.

"%%~F" occupies the position of input-file in the sample command above. It expands to the pathname passed as an argument, with any surrounding quote characters removed, and another set of quote characters explicitly added. So it will work even for input pathnames that contain characters that are special in some way to the cmd interpreter, like spaces.

"%~dp0%%~nF.wav" occupies the position of output-file.wav in the sample command above. It expands to the drive letter and pathname of the folder containing make-wavs.cmd itself (that's the %~dp0 part) followed by the name of the input file, stripped of its own drive letter and folder name and extension and any quotes (that's the %%~nF part) followed by the .wav extension that sets the format of the output file, with the whole thing wrapped in quotes to stop cmd misinterpreting any special characters embedded in it. So the output file ends up with the same name as the input file, saved inside the same folder you put make-wavs.cmd in, in WAV format.

A bash script to do the same job in Ubuntu is similarly tiny. Add a followup comment if you want one but can't figure out how to code it yourself, or if you have any trouble getting the Windows version to work.
posted by flabdablet at 11:15 AM on October 2, 2016 [4 favorites]


Best answer: flabdablet's comment is solid, but if you want an open source product that does everything in a GUI, check out cdrtfe.
posted by Candleman at 1:22 PM on October 2, 2016


I seem to be missing something. Brasero (and presumably cdburnerXP) lets you make audio CDs from any audio file and the conversion happens behind the scenes. Is that a less-than-optimal approach for some reason?
posted by nixxon at 4:18 PM on October 2, 2016 [1 favorite]


Sorry, missing a couple of parentheses. Corrected script:

set ffmpeg="C:\Program Files\ffmpeg\ffmpeg.exe"
for %%F in (%*) do %ffmpeg% -i "%%~F" -vn -ac 2 -ar 44100 "%~dp0%%~nF.wav"

posted by flabdablet at 11:19 AM on October 3, 2016 [1 favorite]


I've done this pretty recently, I can help if you want to write a bash batch based on flabdablet's ffmpeg script.
posted by aspersioncast at 12:15 PM on October 3, 2016


« Older Get married or move to Crone Island?   |   Help Me Identify The Female Vocalist On This CD Newer »
This thread is closed to new comments.