Page 2 of 3

Re: How to fix or listen to broken m4a voice memo file

Posted: Thu Mar 05, 2015 5:28 pm
by gabepsu
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?

Re: How to fix or listen to broken m4a voice memo file

Posted: Thu Mar 05, 2015 6:58 pm
by Gale Andrews
gabepsu wrote:
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 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 http://manual.audacityteam.org/o/man/fa ... html#macff.
gabepsu wrote:
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.
Did you try MediaInfo as I suggested to get its opinion on the good file? http://mediaarea.net/en/MediaInfo/Download/Mac_OS?

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


Gale

Re: How to fix or listen to broken m4a voice memo file

Posted: Thu Mar 05, 2015 8:20 pm
by gabepsu
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?

Re: How to fix or listen to broken m4a voice memo file

Posted: Thu Mar 05, 2015 8:35 pm
by kozikowski
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

Re: How to fix or listen to broken m4a voice memo file

Posted: Thu Mar 05, 2015 8:48 pm
by gabepsu
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.

Re: How to fix or listen to broken m4a voice memo file

Posted: Fri Mar 06, 2015 12:54 am
by Gale Andrews
gabepsu wrote:
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
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 http://www.fosshub.com/MKVToolNix.html.

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

Re: How to fix or listen to broken m4a voice memo file

Posted: Mon Mar 09, 2015 2:18 pm
by gabepsu
OK thanks Gale, I will try the tools you suggested. Thanks again for all of your detailed help :)

Re: How to fix or listen to broken m4a voice memo file

Posted: Mon Mar 09, 2015 3:47 pm
by Gale Andrews
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

Re: How to fix or listen to broken m4a voice memo file

Posted: Thu Jul 09, 2015 5:13 pm
by JiniTwist
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

Re: How to fix or listen to broken m4a voice memo file

Posted: Thu Jul 09, 2015 7:24 pm
by cyrano
gabepsu wrote: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...
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.