Audio duration problem with wavdest

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Hello everyone,

I've been working on some code to extract the audio from a multimedia
file and save the audio as a PCM WAV file. This is a pretty
straightforward problem and my solution was to render a filtergraph
for the multimedia file in question (mpg, mpa, mp2, mp3, aif, wav,
wma, wmv, whatever), then modify the graph to ditch the video and
hook-in the wavedest filter and a filewriter.

This worked like a charm, sort of.

Before I explain the problem, I think it's important to point out the
media files in question are usually close to 2 hours in duration, and
the encoding of these files is outside my control. For this reason, I
see quite an interesting spectrum of goofy bitrates, codecs, dropped
frames, etc. in the files I am trying to process.

Because of the specifics of my application, it is very important the
extracted PCM audio matches (as closely as possible) the original
audio stream within the source multimedia file. Or to put it in
simpler terms, the duration of the extracted PCM audio should very
closely match the original multimedia duration.

I won't go into all the details about why this is so important, but
think of it in terms of seeking to a particular time in both the
source and output. If I seek to 1 hour in both files and hit the play
button, the audio should be a spot-on match.

I wrote a quick batch processor to excercise my code by extracting the
audio from a couple hundred files. The results were not promising.

A very large percentage of files exhibit some pretty big differences
between the original multimedia duation and the extracted audio
duration. Sometimes on the order of 30+ seconds. This is definately
not going to work, so I am trying to figure out what is going on.

I have some guesses, but I was hoping someone might shed some light on
this for me.

My ultimate goal is to identify (1) Why the durations are so
dramatically different and (2) adapt the WavDest to 'insert' or
'delete' samples when appropriate to keep the timebase between my
source and destination the same.

Sorry for the small book, am I making sense? Has anyone got any
ideas?

Thanks!

Geo...



.



Relevant Pages

  • Re: Audio duration problem with wavdest
    ... How are you getting the duration of the original file? ... Unless it was clocked off the audio, then rarely are they going to ... But the relationship between the duration of the output PCM and the ... For instance, after extracting the audio from a 2 hour MPEG-1 stream, ...
    (microsoft.public.win32.programmer.directx.audio)
  • Re: audio extraction questions
    ... similarly accurate program would be needed to extract data off a data disc ... Audio files don't have that advantage, so if you want to make a clean, error-free copy of audio files, you have to use special software like EAC. ... Different drives or different runs with the same drive can ...
    (rec.music.gdead)
  • Re: Audio cd editing
    ... grabber and audacity. ... Lou can you give a short lesson on how to edit using audio ... Put in the CD with the tracks you want to extract, ... For that you need Audacity of another programme like it. ...
    (uk.comp.misc)