• 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: ExtAudioFileRead performance
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ExtAudioFileRead performance


  • Subject: Re: ExtAudioFileRead performance
  • From: William Stewart <email@hidden>
  • Date: Thu, 1 Oct 2009 19:16:34 -0700


On Oct 1, 2009, at 10:45 AM, Dominic Feira wrote:

I'm getting some really poor performance with ExtAudioFileRead sometimes. While reading audio from a m4a with Apple Lossless in it, it sometimes takes an extremely long time to complete the read. Typically it takes on 0.000002 seconds to complete the read. Then out of nowhere it takes approximate 0.4 seconds to complete the read. The reads are for 256 samples of audio at a time. Perhaps this should be larger?

Yes

The only thing that I can think of is disk contention, but at 0.4 seconds that seems like a long time even for disk contention.


Does anybody have any ideas why ExtAudioFileRead could be so slow?

Apple Lossless is packetised into data chunks that are 4096 samples long. So, probably what is happening is that you are reading 1 packet, decoding it (you have 4096 samples), and ExtAudioFile returns you your 256 samples. Then you read again, it already has enough decoded data, so it just passes you back the next 256 samples, and again, until eventually it runs out and has to actually go and read some more and decode it, then it starts again.


But really, this is a very poor way of interacting with the file system. You should be reading larger chunks when you have to go and read.

Bill

Dominic Feira / Code Monkey / Ambrosia Software, Inc. -- http://www.AmbrosiaSW.com

_______________________________________________
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

_______________________________________________ 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: ExtAudioFileRead performance
      • From: Dominic Feira <email@hidden>
References: 
 >ExtAudioFileRead performance (From: Dominic Feira <email@hidden>)

  • Prev by Date: Re: CAF file, testing chunk types?
  • Next by Date: Re: AU, Obj-C and names
  • Previous by thread: ExtAudioFileRead performance
  • Next by thread: Re: ExtAudioFileRead performance
  • Index(es):
    • Date
    • Thread