A M4A audio file can contain AAC audio. If so, then such a M4A file is a container format for AAC audio. It seems that most (all?) general conversion programs, do not convert losslessly between AAC and M4A (containing AAC) files.
A lossless conversion between M4A and AAC audio files, can be done with MP4Box (which is part of "GPAC Framework"), as follows:
How do it (1) - Install MP4Box and create batch files (Windows)
- Install only the MP4Box component from GPAC Framework. I used this version: "gpac-0.7.0-rev27-g0639a09-master-win32.exe", which can be found here.
- Create, based on what you prefer, one or more of the following Windows Batch files (scripts). Use Windows Notepad or another simple text editor to create those files. The name of those files should have a ".bat" extension.
[A] To convert only the relevant files that are in a single folder, and to create a subfolder in that folder, and to put the converted files in that subfolder:
- To convert from M4A to AAC:
m4a2aac.bat@echo offmkdir aacfor %%f in (*.m4a) do "C:\Program Files (x86)\GPAC\mp4box.exe" -raw 1 "%%f" -out "aac\%%~nf.aac"
- To convert from AAC to M4A:
aac2m4a.bat@echo offmkdir m4afor %%f in (*.aac) do "C:\Program Files (x86)\GPAC\mp4box.exe" -add "%%f" "m4a\%%~nf.m4a" -new[B] To convert the relevant files in a folder and all its subfolders, and to add the converted files to that folder and subfolders (without creating any subfolders):
- To convert from M4A to AAC:
m4a2aac_IncludingSubfolders.batFOR /R %%G in (.) DO (
Pushd %%Gfor %%f in (*.m4a) do "C:\Program Files (x86)\GPAC\mp4box.exe" -raw 1 "%%f" -out "%%~nf.aac"Popd )
- To convert from AAC to M4A:
aac2m4a_IncludingSubfolders.batImportant note: The above bat-files only work, when you installed MP4Box in "C:\Program Files (x86)\GPAC\mp4box.exe". If not, change "C:\Program Files (x86)\GPAC\mp4box.exe" in the batch file, into the location where you installed MP4Box. (The batch files work with Windows 7 and later versions of Windows.)FOR /R %%G in (.) DO (Pushd %%Gfor %%f in (*.aac) do "C:\Program Files (x86)\GPAC\mp4box.exe" -add "%%f" "%%~nf.m4a" -newPopd )
How do it (2) - Run batch files
- Place a temporary copy of the relevant batch file in the folder that contains the files to be converted.
- All relevant files in that folder will be converted with "m4a2aac.bat" or "aac2m4a.bat".
- All relevant files in that folder and all its subfolders, will be converted with "m4a2aac_IncludingSubfolders.bat" or "aac2m4a_IncludingSubfolders.bat".
- Double click on the batch file. A temporary progress window will appear, until all relevant files are converted.
- Delete the temporary copy of the batch file.
Why do it
There can be different reasons why one would want to losslessly convert between AAC and M4A audio files. Two such reasons:The above is based on this. See there for other variations of using MP4Box for a lossless conversion between M4A and AAC, including a way to 'preserve' metadata tags.
- It seems that AAC audio files can only be trimmed or cut losslessly with the program "mp3DirectCut". If you want to losslessly trim or cut a M4A audio file (containing AAC audio), you first have to losslessly convert this M4A file to an AAC file. Then you trim or cut this AAC file losslessly in mp3DirectCut. After that, you losslessly convert the trimmed or cut AAC file back to a M4A file.
- In general, AAC audio files do not support metadata tags, while M4A audio files (containing AAC audio) do support metadata tags. So, if you want to have an "AAC audio file with tags", first convert such an AAC file losslessly to a M4A file, and then add tags to that M4A file.
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays! or rip iTunes movies!
+ Reply to Thread
Results 1 to 7 of 7
Thread
-
-
-
Two additions to my earlier post:
[1] If you want to directly losslessly trim or cut a M4A audio file, you can use the program LosslessCut.
[2] It is possible to add this extra functionality to the above four batch files:- Give the target files of the conversion, the same file date as the corresponding source file.
- Make the target files read-only.
After adding the extra functionality to the above four batch files, they will look like this:
m4a2aac.bat
@echo off
mkdir aac
for %%f in (*.m4a) do "C:\Program Files (x86)\GPAC\mp4box.exe" -raw 1 "%%f" -out "aac\%%~nf.aac"
for %%f in (*.m4a) do "C:\Program Files (x86)\Touch\touch.exe" -r "%%f" "aac\%%~nf.aac"
for %%f in (*.m4a) do attrib +R "aac\%%~nf.aac"
aac2m4a.bat
@echo off
mkdir m4a
for %%f in (*.aac) do "C:\Program Files (x86)\GPAC\mp4box.exe" -add "%%f" "m4a\%%~nf.m4a" -new
for %%f in (*.aac) do "C:\Program Files (x86)\Touch\touch.exe" -r "%%f" "m4a\%%~nf.m4a"
for %%f in (*.aac) do attrib +R "m4a\%%~nf.m4a"
m4a2aac_IncludingSubfolders.bat
FOR /R %%G in (.) DO (
Pushd %%G
for %%f in (*.m4a) do "C:\Program Files (x86)\GPAC\mp4box.exe" -raw 1 "%%f" -out "%%~nf.aac"
for %%f in (*.m4a) do "C:\Program Files (x86)\Touch\touch.exe" -r "%%f" "%%~nf.aac"
for %%f in (*.m4a) do attrib +R "%%~nf.aac"
Popd )
aac2m4a_IncludingSubfolders.bat
FOR /R %%G in (.) DO (
Pushd %%G
for %%f in (*.aac) do "C:\Program Files (x86)\GPAC\mp4box.exe" -add "%%f" "%%~nf.m4a" -new
for %%f in (*.aac) do "C:\Program Files (x86)\Touch\touch.exe" -r "%%f" "%%~nf.m4a"
for %%f in (*.aac) do attrib +R "%%~nf.m4a"
Popd )
Similar Threads
-
problem converting .m4a to .aac files
By alex5908 in forum AudioReplies: 48Last Post: 8th Sep 2019, 20:40 -
.aac to .m4a.. possible?
By romi7519 in forum AudioReplies: 35Last Post: 14th Dec 2018, 05:45 -
Cannot join .264 and .m4a (aac) and set aspect from 704/368 to 2.35:1
By Budman1 in forum EditingReplies: 4Last Post: 28th Jan 2018, 23:28 -
change m4a to aac container
By jamespoo in forum MediaReplies: 11Last Post: 7th Feb 2017, 22:15 -
Batch wrap AAC in mp4/m4a
By Kylezo in forum AudioReplies: 6Last Post: 13th Mar 2016, 03:52