Allegro.cc - Online Community

Allegro.cc Forums » Off-Topic Ordeals » help with corrupt IMA ADPCM sound file

This thread is locked; no one can reply to it. rss feed Print
help with corrupt IMA ADPCM sound file
biashead
Member #11,795
March 2010
avatar

hi all,

just found a topic here at Off-Topic Ordeals which is pretty old (may 2008)
and is in connection with my problem:
http://www.allegro.cc/forums/thread/596385

i tried to get in touch with FMC who seems to have the answer, but i don't
think he'd reply as this was too long ago.

the problem is that i have a corrupt IMA ADPCM file that has no header.
(the beginning of the file is missing, not only the header.)
i'd need to fix it to be able to obtain the audio content.

i would be very important.

can anyone help with this?

cheers,
Sebastian.

kenmasters1976
Member #8,794
July 2007

The thread you linked to said:

Long story short, i just copied the header from the other file and then fixed it up for the new file size. :)

Have you tried this?.

Also, can't you play it with VLC or ffplay?.

FMC
Member #4,431
March 2004
avatar

I did reply ;)

But it's better to continue here, more people, better ideas.

[FMC Studios] - [Caries Field] - [Ctris] - [Pman] - [Chess for allegroites]
Written laws are like spiders' webs, and will, like them, only entangle and hold the poor and weak, while the rich and powerful will easily break through them. -Anacharsis
Twenty years from now you will be more disappointed by the things that you didn't do than by the ones you did do. So throw off the bowlines. Sail away from the safe harbor. Catch the trade winds in your sails. Explore. Dream. Discover. -Mark Twain

biashead
Member #11,795
March 2010
avatar

"fixed it up for the new file size" - this is what i could not do.
also, i do not know what length is the header and where exactly it contains the information about the length of the audio stream.

thanks for the reply, FMC, you got mail.

FMC
Member #4,431
March 2004
avatar

Post your file here. :)

[FMC Studios] - [Caries Field] - [Ctris] - [Pman] - [Chess for allegroites]
Written laws are like spiders' webs, and will, like them, only entangle and hold the poor and weak, while the rich and powerful will easily break through them. -Anacharsis
Twenty years from now you will be more disappointed by the things that you didn't do than by the ones you did do. So throw off the bowlines. Sail away from the safe harbor. Catch the trade winds in your sails. Explore. Dream. Discover. -Mark Twain

biashead
Member #11,795
March 2010
avatar

here is the correct file that was edited out/saved from the undeleted file.

FMC
Member #4,431
March 2004
avatar

What's wrong with it? Windows media player plays it, but it's only a few seconds long. How should it be?

[FMC Studios] - [Caries Field] - [Ctris] - [Pman] - [Chess for allegroites]
Written laws are like spiders' webs, and will, like them, only entangle and hold the poor and weak, while the rich and powerful will easily break through them. -Anacharsis
Twenty years from now you will be more disappointed by the things that you didn't do than by the ones you did do. So throw off the bowlines. Sail away from the safe harbor. Catch the trade winds in your sails. Explore. Dream. Discover. -Mark Twain

biashead
Member #11,795
March 2010
avatar

okay, let's start it from the beginning.

i'd need to recover a large voice recording
made with a digital dictaphone.

the recording itself has been lost or deleted,
i don't know. it has most probably been
overwritten with this small recording that i
shared here.

a big file of 218 MBytes has been undeleted/recovered
from the dictaphone's micro card but it is a mixture
of several recordings. i checked it, i could extract
two small recordings from the end of this recovered file
and truncate it so that only the large recording remains
in the file.

but the problem is that it is corrupt, the beginning of
the recording (and the header of course) is missing.
i tried to examine/load it in various applications,
but did not succeed.

could you check the attached file and check if it is
100% Microsoft IMA ADPCM format?

if so, could you help me and explain how i could create
a new header for this corrupt large recording?

FMC
Member #4,431
March 2004
avatar

According to Gspot [1] the header is probably missing or corrupt.

If i understand correctly your problem, you have this big file which actually is a container for wav files, correct?
Your best bet would be to open with a hex editor this big file and look for wav headers. Then copy the data from header to header in a new file.

[FMC Studios] - [Caries Field] - [Ctris] - [Pman] - [Chess for allegroites]
Written laws are like spiders' webs, and will, like them, only entangle and hold the poor and weak, while the rich and powerful will easily break through them. -Anacharsis
Twenty years from now you will be more disappointed by the things that you didn't do than by the ones you did do. So throw off the bowlines. Sail away from the safe harbor. Catch the trade winds in your sails. Explore. Dream. Discover. -Mark Twain

biashead
Member #11,795
March 2010
avatar

i have done it already. i have 2 small files that i could cut from end of the big file. both of them are small few-second recordings and are not important. the rest is a large recording which misses the beginning. i'd need to make a correct header for this big file. how can i do it?

Thomas Fjellstrom
Member #476
June 2000
avatar

You can try taking just the header for the small recordings, put that into a new file, and take the rest of the large file where you notice the sound actually starts, and slap that to the end of the header file you created just before, then modify the length in the header to match the data you added. It might take a little bit of work, but I'm sure you can figure it out.

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

biashead
Member #11,795
March 2010
avatar

"You can try taking just the header for the small recordings, put that into a new file, and take the rest of the large file where you notice the sound actually starts,..."

i don't know if the corrupt file starts properly.
it is truncated at the beginning and knowing that the audio stream is actually a set of audio portions/packets that has fixed length, the file has probably a corrupt audio portion at the beginning.

"...and slap that to the end of the header file you created just before, then modify the length in the header to match the data you added. It might take a little bit of work, but I'm sure you can figure it out."

also, i do not know how to modify the length. for this i should know where i find the info about the length of the recording.

FMC
Member #4,431
March 2004
avatar

I think the audio sample you posted has a corrupt header, what you could do (and what i did) is get a new sample from your recorder, just record something short for a test and post that.

[FMC Studios] - [Caries Field] - [Ctris] - [Pman] - [Chess for allegroites]
Written laws are like spiders' webs, and will, like them, only entangle and hold the poor and weak, while the rich and powerful will easily break through them. -Anacharsis
Twenty years from now you will be more disappointed by the things that you didn't do than by the ones you did do. So throw off the bowlines. Sail away from the safe harbor. Catch the trade winds in your sails. Explore. Dream. Discover. -Mark Twain

Go to: