pause/resume file player... again...
pause/resume file player... again...
- Subject: pause/resume file player... again...
- From: "Chase" <email@hidden>
- Date: Mon, 07 May 2007 22:10:30 +0000
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