Easy way to concatenate a bunch of audio files?

Is there an easy way to concatenate a bunch of audio files in Audacity? I’ve ripped an audiobook from 5 CDs to FLAC files, and I have around 70 of them. Is there an easy way to join all of them into one big FLAC file?

The only way I could find was to drag one clip to the end of the previous one in Audacity, and that’s too tedious to do for the entire thing.

To avoid having to do a lot of manual manipulation, you could use a suitable CD burning program to create a very large CD, but rather than burning a standard CD which is limited to 70 minutes, burn to an iso file. Then mount the iso file as a virtual drive and rip it as a single audio file.

To do it in Audacity, the quickest way that I can think of is to import your files (Ctrl + Shift +I), and check that they are in the correct order (if not, you will either need to rename them before importing, or import them one at a time).

You now have 70 tracks (I hope you have lots of free disk space) in chronological order.

Select track 2 (click on it’s info box)
Press Ctrl + X
Press the “End” key
Press Ctrl + V

Select track 3

Repeat 68 times.

Thanks for the reply. I found a simple way to do the concatenation in Goldwave, a different audio editing program, but unfortunately that means I need to have a copy of windows around as Goldwave is windows only. But that’s still easier than manually joining this many files in Audacity.

I found a command line utility called shntool that can do it, but the problem is, it doesn’t update the header with the length of the concatenated file. When I try to play the file in Amarok (the music player I use) I can’t seek to a point midway through the file because it doesn’t know when the file ends. When I try to open the file in Audacity, it crashes.

Any suggestions on how I might be able to fix the header on the concatenated FLAC file?

What I should have asked “why do you want to do that?”

I presume that it is so that you have the convenience of playing the whole thing through in one go?
Why not use a Play List?

I usually listen to audiobooks on my iPod running Rockbox, and it’s more convenient to have one big audiobook file than a bunch of small tracks. Rockbox can be set to remember your place, and that’s easier than trying to remember which track you were on.

I don’t use RockBox, so I don’t know its abilities or limitations, but you are saying that RockBox can remember its previous position in a file, but cannot remember its previous position in a PlayList?

When you start a PlayList, does it just add the playlist to the queue as a single item, or as a list of tracks? If it adds them as a list of tracks, then in order to remember your place when you stop listening, couldn’t you just need to save the current queue as a new playlist. Perhaps not quite as convenient as having RockBox remembering it automatically, but a lot more convenient than using Audacity to concatenate 70 flac files (which requires a lot of user interaction).

Update - you can do what you are asking for with foobar2000, but again it is a Windows program. Apparently it works well with WINE.

Ah, thanks. I had seen the program but ignored it when I found out it was for Windows. I’ll give it a try with WINE.

In the meantime, I also did the concatenation with Goldwave, which worked fine. Maybe this feature will show up in future Audacity releases.

Here’s the WINE page about foobar2000 http://appdb.winehq.org/objectManager.php?sClass=application&iId=1749

Too late but anyway: What about to convert to RAW format (any kind, just no headers), then
copy file file file file… file ten.raw
copy ten.raw ten.raw … ten.raw 70.raw
of some sort?
(DOS: copy /b file+file+file… ten.raw)
(Unix: cat file file … >ten.raw (mostly works binary))

And then convert from raw to whatever.mp3.

AND ONE MORE - THE EASIST:
Lets simply concatanet MP3, if we do not need any reliability.
(Don’t know much about mp3 but perhaps has some chunks headers and/or sycn marks.)
The following did work for me, I tried on some tiny Audacity export.mp3:
cat tmpyy.mp3 tmpyy.mp3 tmpyy.mp3 tmpyy.mp3 tmpyy.mp3 > tmpzzz.mp3
(playback with Windows Media Something with about tiny pause,
Audacity import shows 10 ms nonsense sound plus 50 ms silence)

I believe amarok looks at the header of the file to get the song length, so just concatenating mp3s like that would confuse it. I’ll look into converting to a raw file and concatenating that.

There is a way how to save disk IO and disk space:

 flac -d -c --force-raw-format  --endian=big --sign=signed   someprefix*.flac |tee tmpx  | flac --force-raw-format --endian=big --sign=signed --channels 2 --bps 16 --sample-rate 44100  -   >  outputfile.flac

(I hope everything is 16bit 44100Hz. Check with metaflac.)

Can make to be an alias command (in unix/cygwin…)
or batch file (DOS/MSwindows), probably even with some drag-and-drop capability.
(BUG: commandline has severe size limit in DOS/mswin)

Wow, that looks like exactly what I needed.

I’ll try it for the next audiobook I rip. Thanks for the help.

I tried it, and it has the same problem I had with shntool. It doesn’t write the tag for the song length.

There ought to be some way to fix the length tag. Any ideas?

Aha, try to replace “> outputfile.flac” with “-o outputfile.flac”.
Should be much better.

flac -d -c --force-raw-format  --endian=big --sign=signed   someprefix*.flac |tee tmpx  | flac --force-raw-format --endian=big --sign=signed --channels 2 --bps 16 --sample-rate 44100  -   -o  outputfile.flac

And maybe you want to put there some sorta ID tags. That could be done by metaflac afterwards.
Im lasy to try or test. So some hints how to do or how to find out.

perhaps this should work

metaflac --list   thefirstfile.flac
metaflac --export-tags-to=FILE thefirstfile.flac

edit FILE
or, to just prepend ALL to the tags:         sed 's/=/=ALL /' FILE >FILE2
or to TITLE only:     sed 's/TITLE=/TITLE=ALL /' FILE >FILE2
or to the end of the tags:        sed 's/$/ ALL/' FILE >FILE2

metaflac --import-tags-from=FILE    theHUGEfile.flac
or
metaflac --import-tags-from=FILE2  theHUGEfile.flac

For more info:
man metaflac

--set-tag=FIELD       Add a tag.  The FIELD must comply with the Vorbis comment
                      spec, of the form "NAME=VALUE".  If there is currently
                      no tag block, one will be created.
--import-tags-from=FILE Import tags from a file.  Use '-' for stdin.  Each line
                      should be of the form NAME=VALUE.  Multi-line comments
                      are currently not supported.  Specify --remove-all-tags
                      and/or --no-utf8-convert before --import-tags-from if
                      necessary.
--export-tags-to=FILE Export tags to a file.  Use '-' for stdin.  Each line
                      will be of the form NAME=VALUE.  Specify
                      --no-utf8-convert if necessary.
--show-tag=NAME       Show all tags where the the field name matches 'NAME'.

I dont know what is cuesheet but you might want to manipulate this, too. By metaflac.
Likewise with seekpoints. The second one is technical but you might enjoy it, to.
--add-seekpoint=600s should speed up the search if you command to play starting from 10minutes from begining.
More in man metaflac.

[/size]