Re: pause/resume file player... again...
Re: pause/resume file player... again...
- Subject: Re: pause/resume file player... again...
- From: William Stewart <email@hidden>
- Date: Mon, 21 May 2007 12:13:31 -0700
I would guess that from your input proc you aren't correlating the
time stamps correctly. The time stamps you get there are going to be
from the device (or from 0 whenever you start/stop AUHAL) - but you
need to cache your "setPlayHeadPosition time stamp" as an offset to
tell you which part of the file to start your reading from
Bill
On 07/05/2007, at 3:10 PM, Chase wrote:
the following code **sort of** works, but not quite. when i hit
the play button, it plays. when i hit pause... it pauses. when i
hit play again, it starts from the beginning AND stays completely
silent until _playPauseTimeStamp is reached and then I hear sound.
can someone explain what i'm doing wrong? thanks. :)
[ code snippet below ]
- chase
- (void)currentFrame:(AudioTimeStamp *)timeStamp
{
UInt32 size = sizeof(AudioTimeStamp);
AudioUnitGetProperty (_audioUnit,
kAudioUnitProperty_CurrentPlayTime, kAudioUnitScope_Global, 0,
timeStamp, &size);
}
- (void)setPlayHeadPosition:(AudioTimeStamp *)timeStamp
{
timeStamp->mFlags = kAudioTimeStampSampleTimeValid;
AudioUnitSetProperty (_audioUnit,
kAudioUnitProperty_ScheduleStartTimeStamp, kAudioUnitScope_Global,
0, timeStamp, sizeof(AudioTimeStamp));
}
- (void)play
{
[self setPlayHeadPosition:_playPauseTimeStamp];
AUGraphStart(_graph);
}
- (void)pause
{
[self currentFrame:_playPauseTimeStamp];
AUGraphStop(_graph);
}
_______________________________________________
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
--
mailto:email@hidden
tel: +1 408 974 4056
________________________________________________________________________
__
"Much human ingenuity has gone into finding the ultimate Before.
The current state of knowledge can be summarized thus:
In the beginning, there was nothing, which exploded" - Terry Pratchett
________________________________________________________________________
__
_______________________________________________
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