dmulholl / mp3cat

A command line utility for joining MP3 files.
https://www.dmulholl.com/dev/mp3cat.html
The Unlicense
186 stars 21 forks source link

concat to singular audio stream? #19

Closed atomGit closed 1 year ago

atomGit commented 4 years ago

i'm looking for a linux CLI util that can merge 2+ mp3s with same bit rate, sample rate, channels, encoder, into a proper mp3 with a single audio stream

the result i'm getting with mp3cat is multiple audio streams

atomGit commented 4 years ago

i should also mention that NOTHING i've found is capable, including mp3wrap, ffmpeg, and lots of home brew attempts

crra commented 4 years ago

Hello @atomGit,

do you mean you want to mix rather than to append? Have you tried 'sox' yet?

Especially:

concatenates two audio files, and sox −m music.mp3 voice.wav mixed.flac

atomGit commented 4 years ago

no, i want to prepend and append a silent track to mp3s - i don't believe sox can do that (or anything) without re-encoding

crra commented 4 years ago

Why don't you create a silence track and add it in between like in: http://activearchives.org/wiki/Padding_an_audio_file_with_silence_using_sox?

Silence track: sox -n -r 44100 -c 2 silence.mp3 trim 0.0 3.0 mp3cat: mp3cat -i silence.mp3 01.mp3 02.mp3

If you want to avoid VBR, you can determine the rate of your input files (assume they are all the same) and generate the corresponding silence file with sox:

$ file 01.mp3 
01.mp3: Audio file with ID3 version 2.3.0, contains:MPEG ADTS, layer III, v1, 192 kbps, 44.1 kHz, Stereo

Here it's 192kbps. Use the '-C' option to specify.

sox -n -r 44100 -c 2 -C 192 silence.mp3 trim 0.0 3.0

philgoetz commented 4 years ago

As I read the sox documentation, it only has a "splice" capability, which is fancy, but can't do a simple join. It always does a cross-fade.

crra commented 4 years ago

Hello Phil,

if you mean with 'simple join': take two files with 1 minute each and later have a file with 2 minutes? This is what 'mp3cat' does if you provide the two files as parameters: mp3cat 01.mp3 02.mp3.

dmulholl commented 1 year ago

Sorry, I think this is out of scope for this tool, which is only intended for simple use-cases. If ffmpeg can't handle it, you may have to wait for the singularity...