Re: iOS4.1, reading sample data while playing audio?
Re: iOS4.1, reading sample data while playing audio?
- Subject: Re: iOS4.1, reading sample data while playing audio?
- From: infrequent <email@hidden>
- Date: Thu, 9 Sep 2010 20:26:21 +0100
The stoppage is because you're trying to access the same file via two
different approaches. Since you have the sample data from
AVAssetReader, you could just play it with an audio unit (which
expects linear pcm anyway) or an audio queue. In both cases you'll
need some sort of callback infrastructure in place to fill your audio
buffers with the data you're reading with AVAssetReader. You
definitely can't get anything from MPMusicPlayerController, though.
hth,
Pierre
On Wed, Sep 8, 2010 at 8:20 PM, Jason Staczek <email@hidden> wrote:
> Hi,
> I'm trying to display a spectrum for an audio file during playback. I'm
> playing back using an MPMusicPlayerController. I'm reading using
> AVAssetReader. I'm able to read just fine as long as I'm not playing back.
> But if I start playback, then call back to calculate the spectrum on a timer
> reading audio at the current playback time, playback stops as soon as I try
> to read.
> I guess there are two questions.
> - Is there a better way to do this? Since I'm already playing, is there a
> way to get the sample data without re-reading?
> - Should I be doing this on an NSTimer, or is there a better way to get
> called from the audio system periodically?
> Thanks,
> Jason
> _______________________________________________
> 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