• 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: Using AVPlayer to play MPMediaItem and add iPod EQ to the output
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using AVPlayer to play MPMediaItem and add iPod EQ to the output


  • Subject: Re: Using AVPlayer to play MPMediaItem and add iPod EQ to the output
  • From: Fedry Kemilau <email@hidden>
  • Date: Wed, 01 Aug 2012 15:40:16 +0700

Hi Kevin,

How do you determine if there is silence in the beginning or end of an MPMediaItem?

Regards,
Fedry


On 1 Aug, 2012, at 3:29 PM, Heinrich Fink <email@hidden> wrote:

I am glad that worked for you. I still haven’t found a way how to access the actual number of valid audio samples ahead of copying the complete file. I will start a separate thread on this issue here.

Just in case you don’t know that one already: ‘afinfo’ is a really useful tool to introspect an audio file from the command line. It also shows you the amount of prime/remainder samples of a compressed file.

best regards,

Heinrich

On Jul 31, 2012, at 23:52 , Kevin Dixon <email@hidden> wrote:

> Thanks Heinrich, I hadn't known about that property before. Now that I
> am setting it to YES, I actually see a different behavior in
> decoding-- those songs which I expect to be gapless are indeed playing
> that way (I suppose removing the priming/remainder samples?)
>
> -Kevin
>
> On Tue, Jul 31, 2012 at 1:06 PM, Heinrich Fink <email@hidden> wrote:
>> hi kevin,
>>
>>> This works well enough, but I've noticed that some tracks that play as
>>> gapless under the main iOS Music App, or even in Winamp do not come
>>> out gapless through this API. The decoded MP3s (from AVAssetReader)
>>> may have 500-2000 samples of silence at the beginning or end, so I'm
>>> curious about this as well.
>>
>> I believe what you describe are the priming/remainder samples which are specific to some audio codecs. AAC, for example, could have something like 2112 priming sample and 134 remainder samples. I think there are similar numbers for the mp3 codec.
>>
>> I have also recently build an audio scheduling system with an AUGraph that uses an AVAssetReader to access audio samples. I use an AVAssetReaderTrackOutput that is configured to return decoded non-interleaved float audio data. I ran into a problem that is similar to yours: When I read the AVURLAsset’s property “duration” (I have set ’AVURLAssetPreferPreciseDurationAndTimingKey’ set to ‘YES’): the returned property shows the full number of samples (priming samples + valid samples + remainder samples). However, I believe the correct number should be the ‘valid’ samples only as this is also the amount of samples returned by the AVAssetReaderTrackOutput. The ExtAudioFile API, for example, explicitly handles priming/remainder samples (checkout the property kExtAudioFileProperty_PacketTable described here http://developer.apple.com/library/ios/#documentation/MusicAudio/Reference/ExtendedAudioFileServicesReference/Reference/reference.html#//apple_ref/doc/c_ref/kExtAudioFileProperty_PacketTable)
>>
>> I have filed a bug about the AVURLAsset.duration not returning the correct amount of actual decodable audio samples. Does anyone else have experience with AVFoundation and priming/remainder samples?
>>
>> best regards,
>>
>> Heinrich Fink
>>
>


_______________________________________________
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: Using AVPlayer to play MPMediaItem and add iPod EQ to the output
      • From: Kevin Dixon <email@hidden>
References: 
 >Re: Using AVPlayer to play MPMediaItem and add iPod EQ to the output (From: Heinrich Fink <email@hidden>)

  • Prev by Date: Re: Using AVPlayer to play MPMediaItem and add iPod EQ to the output
  • Next by Date: AVURLAsset.duration on AAC-compressed files is not returning the correct sample count.
  • Previous by thread: Re: Using AVPlayer to play MPMediaItem and add iPod EQ to the output
  • Next by thread: Re: Using AVPlayer to play MPMediaItem and add iPod EQ to the output
  • Index(es):
    • Date
    • Thread