Have you ever recorded several audio files on your iPhone, only to realize you need them in .mp3 format for easier sharing, editing, or publishing? Hereโs a simple and effective way to convert and merge multiple .m4a files into a single .mp3 file using ffmpeg on a Linux system.
๐ ๏ธ Step 1: Convert .m4a Files to .mp3
Assume you have three .m4a files saved from your iPhone:
ffmpeg -i 'file-1.m4a' -codec:a libmp3lame -qscale:a 2 2025-05-08_file-1.mp3 ffmpeg -i 'file-2.m4a' -codec:a libmp3lame -qscale:a 2 2025-05-08_file-2.mp3 ffmpeg -i 'file-3.m4a' -codec:a libmp3lame -qscale:a 2 2025-05-08_file-3.mp3
๐ Tip: The -qscale:a 2 flag sets high audio quality. Lower numbers mean better quality (and larger files).
๐ Step 2: Create a Playlist File for Concatenation
Youโll need to prepare a text file that lists the MP3 files in the correct order for merging:
cat mp3_list.txt
file '2025-05-08_file-1.mp3' file '2025-05-08_file-2.mp3' file '2025-05-08_file-3.mp3'
๐ Step 3: Merge the MP3 Files into One
Use ffmpeg with the concat demuxer to join all MP3s into a single file:
ffmpeg -f concat -safe 0 -i mp3_list.txt -c copy 2025-05-08__full_output_combined_3_files.mp3
And voilร โ you now have a single MP3 file that combines all three recordings!
๐ See Also
For more on merging MP3 files with ffmpeg, check out this helpful StackOverflow thread.