• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: why does the MovieAudioExtraction API require a "sample rollback?"
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: why does the MovieAudioExtraction API require a "sample rollback?"


  • Subject: Re: why does the MovieAudioExtraction API require a "sample rollback?"
  • From: Brian Whitman <email@hidden>
  • Date: Thu, 6 Apr 2006 19:50:37 -0400


On Apr 6, 2006, at 6:11 PM, Daniel Steinberg wrote:

The result is that every time you reposition AudioExtraction, the MP3 decoder gets reset, and the first N samples that emerge are zeroes. I believe that you will find that if you encode a sinwave and do your scatter/gather extraction *even with the 2 second priming* you will still hear artifacts. The only way to get perfectly seamed data for MP3 is to reposition the AudioExtraction to the start of the file *every time*, and decode and discard up to the desired start position.


We could do this in MovieAudioExtraction behind your back when there's an MP3 audio track, but obviously it would make the performance go to hell as the extraction start time increases. Would that be desirable?

Starting at 0 for every 'random access' is untenable, yes, and I understand the issues. And yes, I just uncovered that rolling back 2 seconds was not enough, I had to go all the way back to 0 for the MovieAudioExtraction to work properly.


But: CoreAudio's AudioFile API and the QT soundConverter/ GetMediaSample both handled MP3 files fine if you rolled them back enough. (By "fine" I mean there were no noticeable clicks or dropouts.) I don't know what the difference is between these methods.

I'm going to make a chart of the PCM extraction for random access mess:

1. CAAudioFile:
The good: 1152*2 sample rollback works fine for most all filetypes & samplerates
The bad: hangs/crashes on corrupted mp3 files, eating up memory and probably open to some buffer overflow vulnerability (bug# 4379707), doesn't pay attention to type codes, only file extensions (bug #4422986)


2. QT/SoundConverter:
The good: does not crash on bad files. Rollback 7 frame fix works for most files
The bad: rollback does not fix non-native sample rate packetized formats, causes clicks/dropouts


3. QT/MovieAudioExtraction:
The good: new API, recommended, doesn't crash on bad files, handles all non-MP3 files great, ABL for nice AUScheduledSoundPlayer
The bad: QT7 only, rollback does not fix MP3 files.


So, some combination of these 3 APIs would work.

I am so sorry this has become my perennial hobbyhorse. I promise I want to do other things with my time!!!

-brian

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Prev by Date: Re: AudioOutputUnit and QT audio extraction - back to basics
  • Next by Date: CAAudiofile.h in CoreAudio Public Utility and other things
  • Previous by thread: mp3 AudioConverter hangs
  • Next by thread: CAAudiofile.h in CoreAudio Public Utility and other things
  • Index(es):
    • Date
    • Thread