• 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: Slow seeking in MP3 files using ExtAudioFile
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Slow seeking in MP3 files using ExtAudioFile


  • Subject: Re: Slow seeking in MP3 files using ExtAudioFile
  • From: Hamish Allan <email@hidden>
  • Date: Thu, 22 Jan 2009 19:53:05 +0000

On Tue, Jan 20, 2009 at 10:11 PM, Jeff Moore <email@hidden> wrote:

> MPEG-1/2 files do not have anything like a packet table or table of contents
> in them. So, to seek to a position in the middle of the file requires
> parsing the file from the beginning. Note that this is the case regardless
> of whether you are talking a VBR or CBR MP3 encoding. The reason why is that
> there are no rules about what you can stick between packets and there are
> apps that will put stuff there.

I've been trying to write code to allow for playback of and random
seeking within files that are still being downloaded (as per Quicktime
Player). On the assumption that AudioFile/ExtAudioFile will get
confused if the full data is not available from the outset, my
approach has been to use an AudioFileStream to read the first few
packets until the bitrate is reasonably stable, then use that to allow
skipping (simply jumping to a byte offset within the data and passing
kAudioFileStreamParseFlag_Discontinuity). This approximation has been
reasonable for my purposes, but presumably would get less accurate if
more metadata e.g. album artwork were present.

However, it seems that AudioFileStreamParseBytes() always outputs
exactly as many bytes as it is input, i.e., doesn't drop inaudible
frames such as ID3v2. (I guess that's handled by the AudioQueue?) So
what is the best way to build a table of contents translating seconds
into packet offsets? Do I have to examine the packets myself?

Or maybe there's something I'm missing, an easier way to do the whole
task? Any advice gratefully appreciated.

Thanks,
Hamish
 _______________________________________________
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

  • Follow-Ups:
    • Re: Slow seeking in MP3 files using ExtAudioFile
      • From: William Stewart <email@hidden>
    • Re: Slow seeking in MP3 files using ExtAudioFile
      • From: Christopher Atlan <email@hidden>
References: 
 >Slow seeking in MP3 files using ExtAudioFile (From: Jens Alfke <email@hidden>)
 >Re: Slow seeking in MP3 files using ExtAudioFile (From: Jeff Moore <email@hidden>)

  • Prev by Date: Re: Question regarding sound card output latency
  • Next by Date: AudioFileCountUserData
  • Previous by thread: Re: Slow seeking in MP3 files using ExtAudioFile
  • Next by thread: Re: Slow seeking in MP3 files using ExtAudioFile
  • Index(es):
    • Date
    • Thread