Methods to Repair m4a Recording Files

Voice files (m4a) recorded with apps like Voice Memos on iPhone / Apple Watch or Recorder on Android phones can sometimes become corrupted and unplayable.

If the corrupted file still has some size to it, it may be possible to recover it yourself by using a binary editor and a tool called faad (Free Advanced Audio Decoder).

m4a files with multiple ‘mdat’ tags

Before iOS 13, m4a files only had one “mdat” tag. However, with iOS updates, a new file format with multiple “mdat” tags has emerged.

Consequently, the repair method described in the previous post on the no longer works.

After further research, I’ve discovered a new method to successfully recover these files, which I am sharing here.

new m4a file format repair method

The following method is compatible with both Windows and Mac.

1. install tools

  • Hex Editor
  • faad (Free Advanced Audio Decoder)
    • This tool decodes audio data compressed in AAC.
    • For Windows, download the latest FAAD2 from https://www.rarewares.org/aac-decoders.php.
    • For Mac, install it with the following steps:
      • Open the Terminal.
      • If Homebrew is not installed, install it first.
      • In the Terminal, execute the command brew install faad2 to install FAAD2.
      • After installation, check the version with the faad command to ensure successful installation.
  • ffmpeg
    • It is a free, open-source software for handling video, audio, and other multimedia files and streams.
    • For Windows:
      • Download from FFmpeg’s official site https://ffmpeg.org/. Select “Windows builds from gyan.dev” or other builds in the “Download” section.
      • Extract the downloaded ZIP file.
      • Set the environment variable by adding the path of the ‘bin’ directory in the extracted folder to your system’s ‘Path’ variable.
      • Verify installation by running ‘ffmpeg -version’ in the command prompt.
    • For Mac
      • Install Homebrew if not already installed.
      • Install FFmpeg using the command brew install ffmpeg.
      • Verify installation by running ‘ffmpeg -version’ in the terminal.

2. search and delete the ‘mdat’ tag

  • Search for the ‘mdat‘ tag within the m4a file. Use the search menu or Ctrl + F (Cmd + F on macOS).
  • Delete the data up to the first ‘mdat’ tag (including the tag itself).

3. decode with faad tool

  • Save the file as ‘0000.raw‘ after deletion.
  • Decode using the faad tool with parameters appropriate to the recording’s sampling frequency.
    • For recent iOS Voice Memos or PCM recordings (48000Hz):
      faad.exe -s 48000 0000.raw
    • For older iOS Voice Memos (44100Hz):
      faad.exe 0000.raw
    • If unable to decode, try different sampling frequencies with the ‘-s’ option as below:
      faad.exe -s 8000 0000.raw
      faad.exe -s 16000 0000.raw
      faad.exe -s 22050 0000.raw
      faad.exe -s 24000 0000.raw
      faad.exe -s 32000 0000.raw
  • If successful, a file named ‘0000.wav‘ will be created.

4. repeat the process

  • Search for ‘mdat’ again and repeat the deletion and decoding process until no more ‘mdat’ tags are found.
  • Save subsequent files as ‘0001.raw’, ‘0002.raw’, etc.

5. combine fragments

  • List all recovered WAV files (e.g., 0000.wav, 0001.wav, etc.) in a text file, like filelist.txt.
  • Use the following command to combine them: ffmpeg -f concat -safe 0 -i filelist.txt -c copy output.wav

6. generate the repaired file (m4a)

  • Encode the combined WAV file back into the m4a format: ffmpeg -i output.wav -acodec aac repaired.m4a
  • You can specify encoding options like bitrate, sample rate, and channel count if needed.

Cautions

  • This process is manual and can be time-consuming.
  • There’s a risk of accidentally deleting important parts of the file, so it’s important to have a backup of the original file.
  • There may be cases where the original recording is partially or completely lost due to the damage, and it may not be fully recoverable.

Conclusion

I hope this method proves to be useful information for technicians and general users interested in repairing audio files.

Repair Service

If you want us to repair your corrupted files, please send email to repair_m4a_service@sysfrontier.com.

The price depends on the recording length recovered as shown below:

Length recoveredFee
0 – 15 minutes$10
15 – 60 minutes$20
1 – 2 hours$30
2 – 4 hours$40
4 – 8 hours$50
more than 8 hours$60

It usually takes one or two days to repair a file. If it is urgent, we can repair it within a few hours, but the additional fee, $20, is required.

You can pay the fee via PayPal.

If the file is very large, please upload it to Dropbox, Google Drive, or WeTransfer and send us the share link.


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *