AudioQueueStart- This is not a feature to help you do this. Time is there, like a delay, if you pass NULL, it means that the queue will start as soon as possible.
, , , , (), .
, SpeakHere
( obj++) SpeakHere
AQPlayer.h :
UInt64 mPacketCount;
:
void SetQueuePosition(float position) { mCurrentPacket = mPacketCount*position; };
AQPlayer.mm AQPlayer::SetupNewQueue() mIsInitialized = true; :
UInt32 sizeOfPacketsCount = sizeof(mPacketCount);
XThrowIfError (AudioFileGetProperty (mAudioFile, kAudioFilePropertyAudioDataPacketCount, &sizeOfPacketsCount, &mPacketCount), "get packet count");
( SpeakHereControler.mm UISlider, ):
- (IBAction) sliderValueChanged:(UISlider *) sender
{
float value = [sender value];
player->SetQueuePosition(position);
}
:
AudioQueueOutputCallback, SpeakHere: void AQPlayer::AQBufferCallback( , , ) AudioFileReadPackets, . mCurrentPacket, , , , , , , , :)
:)
( objc) SpeakHere
AudioPlayer.h :
UInt64 totalFrames;
AudioPlayer.m
- (void) openPlaybackFile: (CFURLRef) soundFile
:
UInt32 sizeOfTotalFrames = sizeof(UInt64);
AudioFileGetProperty (
[self audioFileID],
kAudioFilePropertyAudioDataPacketCount,
&sizeOfTotalFrames,
&totalFrames
);
AudioPlayer.h .m
- (void) setRelativePlaybackPosition: (float) position
{
startingPacketNumber = totalFrames * position;
}
( AudioViewController UISlider, ):
- (IBAction) setPlaybackPosition: (UISlider *) sender
{
float value = [sender value];
[audioPlayer setRelativePlaybackPosition: value];
}
0, , 0,5 ..
, .