time vs packets
time vs packets
- Subject: time vs packets
- From: Torsten Curdt <email@hidden>
- Date: Tue, 14 Dec 2010 00:41:15 +0100
Hey,
for an iPhone project I've tried to stick with AVAudioPlayer
...unfortunately it does not let me play only part of the audio file.
(What I would like to do: play seconds 5-10 of a 30s sample. In fact I
would even like to fade the sample in and out - but that's for another
thread I guess)
So I ended up writing my own audio player using AudioQueues. It plays
fine and even the scrubbing works. That said: what I am using to scrub
through the file is to change the current packet - not time.
AudioFileReadPackets(_audioFile, false, &numBytes, _packetDescs,
_currentPacket, &numPackets, buffer->mAudioData);
This should be OK for a CBR ...not so much for a VBR I presume.
Looking through the API I found AudioQueueCreateTimeline and friends.
IIUC one can attach a timeline to an audioqueue to figure out where
the audio device really is. But how do I go the other way?
For a correct scrubber and for picking an exact part out of a file I
would need to convert time into packet number.
Any suggestions? Just pointing me into the right direction would be great.
cheers,
Torsten
_______________________________________________
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