Easy way to concatenate a bunch of audio files?

Effects, Recipes, Interfacing with other software, etc.
Forum rules
If you require help using Audacity, please post on the forum board relevant to your operating system:
Windows
Mac OS X
GNU/Linux and Unix-like
DinkyDogg
Posts: 7
Joined: Fri May 23, 2008 7:13 am
Operating System: Please select

Re: Easy way to concatenate a bunch of audio files?

Post by DinkyDogg » Thu May 29, 2008 9:57 pm

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.

jan.kolar
Posts: 273
Joined: Sat May 24, 2008 7:01 pm
Operating System: Please select

Re: Easy way to concatenate a bunch of audio files?

Post by jan.kolar » Fri May 30, 2008 5:33 pm

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

Code: Select all

 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)

DinkyDogg
Posts: 7
Joined: Fri May 23, 2008 7:13 am
Operating System: Please select

Re: Easy way to concatenate a bunch of audio files?

Post by DinkyDogg » Fri May 30, 2008 9:47 pm

Wow, that looks like exactly what I needed.

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

DinkyDogg
Posts: 7
Joined: Fri May 23, 2008 7:13 am
Operating System: Please select

Re: Easy way to concatenate a bunch of audio files?

Post by DinkyDogg » Sun Jun 01, 2008 5:07 am

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?

jan.kolar
Posts: 273
Joined: Sat May 24, 2008 7:01 pm
Operating System: Please select

Re: Easy way to concatenate a bunch of audio files?

Post by jan.kolar » Sun Jun 01, 2008 9:43 am

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

Code: Select all

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

Code: Select all

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

--

Code: Select all

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]

Post Reply