How to fix or listen to broken m4a voice memo file

I have the latest version (I believe?) of Audacity, 2.0.6
I am running OSX Yosemite version 10.10.2

I recorded a voice memo on my iPhone and the battery shut down so I believe the recording did not save properly. On my iPhone the file shows as 00:00 in length however the file itself is over 540MB. I transferred the file to my MAC via USB cable through iTunes and saved to desktop. I also transferred a much smaller recording which did save properly.

After following some videos on YouTube and on this forum, I tried importing raw data in Audacity and mimicked the settings I found in the smaller recording, which was 16bit PCM with sample rate 22050 Hz.

However after trying this, the file still only opens as static. Is there anything else I am missing to be able to access this audio recording?

to my MAC via USB cable through iTunes

Did it play while it was in iTunes?

Open up the other successful file in QuickTime, make sure it plays and Command-I INFO. What does INFO say that file is? The busted file is likely to have the same specifications.

The Raw tools in Audacity depend on you to to tell it everything about the file. It makes no assumptions or presets. Noise is usually what you get when you guess wrong

Koz

Did you install the FFMpeg software? I don’t think plain Audacity will know what an m4a file is.

http://audacityteam.org/download/mac

Koz

On Mac only, Audacity can import unprotected M4A, MP4 and MOV files without FFmpeg, assuming QuickTime understands the file.

QuickTime may not be able to understand an M4A file containing PCM audio, so it may be worth trying FFmpeg.


Gale

Hi Koz - The broken file did not open in iTunes. I opened the successful file in Quick Time and I got this for INFO:

Format: AAC, 22050 Hz, Stereo (L R)
Data Size: 55KB
Data Rate: 24.57 kbit/s

I have installed the FFMpeg software according to the instructions on the Faq page
I have restarted Audacity.
I tried importing Raw Data again using the following settings:

Encoding: Signed 16 bit PCM
Byte order: Default endianness
Channels: 2 Channels (Stereo)
Start offset: 0 bytes
Amount to import: 1% (because its 540mb)
Sample rate: 22050

…and I still just get noise?

Gale - Is there a way to check that the FFMpeg installed correctly?

Also - I did just see that on the sidebar showing the settings for the imported file read as:
Stereo, 22050 Hz, 32 bit float (not 16)

would that have anything to do with it?
is there a place for me to add Data Rate, such as that I found on the successful file (24.57 kbit/s)?

If that file was 16-bit PCM stereo 22050 Hz then QuickTime should be saying that it’s 705 kbps.

The file could be Big Endian, given an Apple app produced it.

I would suggest you import 100%.

Look at Audacity > Preferences… then the Libraries section to see if F, C and U numbers are listed for FFmpeg.

If the file lacks proper headers then FFmpeg will not be able to open it. If you want to force FFmpeg to try to open it in Audacity, use File > Import > Audio…, then choose “FFmpeg-compatible files” before selecting the file.

No - that’s just the resolution Audacity opens the file at, determined by “Default Sample Format” in the Quality section of Audacity Preferences. If the settings in Raw Audio are correct and the data is legitimate, then the default 32-bit sample format setting would import the audio correctly.


Gale

Did you check that QuickTime has export options? You may be able to get QuickTime to convert the work into something that will slide right into Audacity instead of trying to painfully force Audacity to open an odd format (click on the pix).

Koz
Screen Shot 2015-02-28 at 17.16.09.png

Thx Koz - I tried exporting via Quicktime as you suggested but it still won’t allow me to open it.

Gale - Thx again for all of the detailed help, as well.
I tried importing again using Big endian and importing 100% and I still get noise and no waveform.
I did check the FFmpeg settings as you mentioned and they are installed.
If the file is lacking the proper headers, is there anything I can do to correct this?

Also - since u mentioned that

If that file was 16-bit PCM stereo 22050 Hz then QuickTime should be saying that it’s 705 kbps.

could I do anything to correct this on my end in the settings of the import for the broken file?

What happens if you import the bad file into Audacity by File > Import > Audio…, then choose “FFmpeg-compatible files” before selecting the file?

Does the good file import properly if you Import Raw with the settings you were trying?

Does the bad file Import Raw at the length you were expecting , with noise along the whole length?

Import Raw should solve that by bypassing the headers or lack of them, if the file really contains PCM audio. When you enter the details manually you’re supplying the information that the headers should be supplying.

Probably not. You could try MediaInfo to get a second opinion about the good file MediaInfo - Download MediaInfo for macOS, but they don’t say if it runs on Yosemite or not.

Presumably Quick Time can’t play the bad file?


Gale

What happens if you import the bad file into Audacity by File > Import > Audio…, then choose “FFmpeg-compatible files” before selecting the file?

When I tried this, the file says
(file) is an Advanced Audio Coding file.
Audacity cannot open this type of file.
You need to convert it to a supported audio format, such as WAV or AIFF.


Does the good file import properly if you Import Raw with the settings you were trying?

I tried this, and actually it does not. I tried the following settings with the good file
Unsigned 8 bit PCM, little endian, 2 channels, 22050hz
Unsigned 8 bit PCM, Big endian, 2 channels, 22050hz
Signed 16 bit PCM, little endian, 2 channels, 22050hz
Signed 16 bit PCM, Big endian, 2 channels, 22050hz
Signed 32 bit PCM, little endian, 2 channels, 22050hz
Signed 32 bit PCM, Big endian, 2 channels, 22050hz

…and all i got was noise. So maybe I’m onto something? My guess is I have to find the correct settings on this working file. When I Import → Audio → on the working file, a screen shows that its importing FFMpeg compatible files, and then it imports perfectly. I can see the wave form, it plays great. So I’m assuming when I import raw data, there are some ffmpeg files that are not getting added which could affect the settings?

Do I really have to try all combinations of settings? What are the most likely encoding settings?
Is there a way to see what the encoded settings are for the working file AFTER i have done Import → Audio?

Does that happen even though you can import the good file using FFmpeg as you seem to state below?

When you open Audacity > Preferences… then look in the “Libraries” section, do you see “FFmpeg library not found”? If so, go back and follow the instructions at Audacity Manual.

Did you try MediaInfo as I suggested to get its opinion on the good file? MediaInfo - Download MediaInfo for macOS?

I’m not convinced that file contains PCM. How long is it? Is it really only 55 kB in size?


Gale

Does that happen even though you can import the good file using FFmpeg as you seem to state below?

Yes when I import the good file as Import → Audio, the FFmpeg files are downloaded and the good working files opens and plays perfectly. This is the file that is only 55kb in size.
When I checked under Libraries, the FFmpeg Library Version shows as F(55.33.100), C(55.52.100), U(52.66.100)

When I import the good working file (55kb) as Import → Raw Data, I use the settings i mentioned in my previous post and all I got was noise.

So I checked out the Mediainfo app and I opened the working file.

This is what it says:
General
Complete name : /Users/Desktop/20150224_115436.m4a
Format : MPEG-4
Format profile : Apple audio with iTunes info
Codec ID : M4A
File size : 53.9 KiB
Duration : 7s 291ms
Overall bit rate mode : Constant
Overall bit rate : 60.5 Kbps
Encoded date : UTC 1948-11-06 18:43:29
Tagged date : UTC 1948-11-06 18:43:29

Audio
ID : 1
Format : AAC
Format/Info : Advanced Audio Codec
Format profile : LC
Codec ID : 40
Duration : 7s 291ms
Bit rate mode : Constant
Bit rate : 24.6 Kbps
Nominal bit rate : 32.8 Kbps
Channel(s) : 2 channels
Channel positions : Front: L R
Sampling rate : 22.05 KHz
Compression mode : Lossy
Stream size : 21.9 KiB (41%)
Language : English
Encoded date : UTC 1948-11-06 18:43:29
Tagged date : UTC 1948-11-06 18:43:29

When I opened the non working file in mediainfo, the only info I got was this:
General
Complete name : /Users/Desktop/20150223_074157.m4a
Format : MPEG-4
Format profile : Apple audio with iTunes info
Codec ID : M4A
File size : 541 MiB

Can anyone make any recommendations from where I can go with this?

Presumably Quick Time can’t play the bad file?

The poster said it would. That’s why I suggested using QuickTime Export to produce a different file type.
Koz

The poster said it would. That’s why I suggested using QuickTime Export to produce a different file type.

My apologies, I meant to say QuickTime only opened the working file.

I would trust MediaInfo here. If the good file is 7 seconds long then it would have to be at least 500 kB to really be “22050 Hz 16-bit stereo PCM”.

Audacity can’t help with this. You should start searching online for M4A repair - but at least a couple of the tools will point you to paid services that could cost $100 or so. There seem to be a few free repair tools you could try.

The best “free” approach if all else fails may be to try to write it to a new container using some app like mkvmerge that may be able to handle headerless AAC (which is almost what you have). You could try this set of tools which includes mkvmerge MKVToolNix download latest version.

SoX http://sox.sourceforge.net/Main/HomePage “may” do what you want if used with FFmpeg but it is command-line only and I’m unclear how “simple” it is to use it with FFmpeg. You could ask on the SoX mailing lists for help or on the hydrogenaudio or doom9 forums for help with mkvmerge or other possible solutions.


Gale

OK thanks Gale, I will try the tools you suggested. Thanks again for all of your detailed help :slight_smile:

If you find a good, free M4A repair tool please let us know. There are number of MP3 repair tools but AAC audio is much harder to “repair”.


Gale

So I have something of interest to add to this puzzle. I’m in the same situation, but when I load up my voice memos on my phone in iExplorer, despite there being no time code listed on the file, I -CAN- get the audio to play in its native player. However, when I export the file, it’s considered corrupted everywhere else and unrecognized.

So whatever causes iExplorer to be able to read/play the audio despite everything, even though the file itself cant be read elsewhere when exported/copied, (though iExplorer reads the phone directories, not the computer, so can’t tell if it would be able to read the exported version too), that trait is what lets these corrupted files be read. Anyone know where to go from here?

Personally, I’m just gonna re-record the memo from the system audio playback in audacity, and I doubt any kind of “lossiness” resulting from that will make even the quiet speech unrecognizable. But I have the exported copy and the native file still, so a direct way to open it would be great. Anyone able to understand how iExplorer is coded, in regards to viewing/playing m4a’s? The native player appears to be Quicktime, but quicktime as a standalone program won’t open the exported files. Strange

How long would the recording be?

540 MB at 22 KHz is loooooong. So I’d suspect the EOF to be missing?

After following some videos on YouTube and on this forum, I tried importing raw data in Audacity and mimicked the settings I found in the smaller recording, which was 16bit PCM with sample rate 22050 Hz.

Isn’t it an AAC (Apple compressed) file?

However after trying this, the file still only opens as static. Is there anything else I am missing to be able to access this audio recording?

iTunes and Audacity + ffmpeg should read AAC.