Re: Using AVPlayer to play MPMediaItem and add iPod EQ to the output
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: Tue, 31 Jul 2012 16:23:53 +0700
Thank you all for the help. :)
After playing around with AVAssetReader & Audio Unit, now I am able to play MPMediaItem and add the presets iPod EQ to the output.
I have another question regarding gapless playback.
From the raw data retrieved using AVAssetReader, how do we detect if a song is set as gapless?
How can I play gapless songs without any delay when continue from one to another?
Maybe there is part of data that I should strip off from the beginning and the end of the raw data.
On 21 Jul, 2012, at 11:21 AM, Bill Phillips <email@hidden> wrote:
Not only is AVAssetReader the only option for the task you have in
mind, but I have myself written the back end for an app with exactly
the specifications you describe! :)
You are right that AVAssetReader itself does not provide seeking.
However, it is possible to open an AVAsset at a particular time. Using
that, you can then implement seeking, fast forward, rewind, continuing
from a certain playback time, skipping, etc. by closing your
AVAssetReader and constructing a new one. That is enough to build an
entire back end on top of AVAsset+friends.
Unfortunately, it is much more work than using AVPlayer is.
On Sat, Jul 21, 2012 at 12:03 AM, Fedry Kemilau <email@hidden> wrote:
> First of all, thank you for all responses.
>
> This is what I got from some reading on Audio Unit and AVAssetReader.
>
> Using AVAssetReader, I need to use the [AVAssetReader copyNextSampleBuffer].
> This function reads the data from MPMediaItem asynchronously because we have to keep looping until the end of the audio file.
> Which I think it is not suitable for my app, where users can fast forward / rewind, continue from a certain playback time or skip to next song immediately.
>
> Using Audio Unit, the function ExtAudioFileRead reads the raw bytes synchronously. I think this function is more suitable, however it is not possible to read MPMediaItem raw bytes.
>
> Any advice? Or did I still miss something in Audio Unit?
>
> Regards,
> Fedry
>
> On Jul 21, 2012, at 3:09 AM, Bill Phillips wrote:
>
> If I'm reading the source correctly here, DiracAudioPlayer will not
> work for MPMediaItem playback. NSURLs provided by MPMediaItem may only
> be opened by classes in AVFoundation, e.g. AVURLAsset.
>
> You can pull raw bytes from an AVAsset with AVAssetReader and friends,
> and you can then feed those bytes into an AUGraph of your own
> construction as Tahome has advised above.
>
> On Fri, Jul 20, 2012 at 11:52 AM, tahome izwah <email@hidden> wrote:
>> ...or, you could use a 3rd party substitute for AVAudioPlayer for
>> this. DSP Dimension has an example project called "DiracAudioPlayer"
>> that does the same thing AVAudioPlayer does except that you can change
>> the speed of the playback in real time (time stretching). It's quite
>> handy for all sorts of things and they included the entire source code
>> for the class: http://dirac.dspdimension.com (you'll want to download
>> the DiracLE package).
>>
>> You could then replace their time stretching aspect with an EQ easily
>> and be done in a couple of minutes.
>>
>> HTH
>> --th
>>
>> 2012/7/20 tahome izwah <email@hidden>:
>>> Yes you will have to set up your own graph for this.
>>>
>>> --th
>> _______________________________________________
>> 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
>
_______________________________________________
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