Re: time vs packets
Re: time vs packets
- Subject: Re: time vs packets
- From: Wil Macaulay <email@hidden>
- Date: Mon, 13 Dec 2010 19:36:05 -0500
If you use the ExtAudioFile APIs, you can extract your file into LPCM, in which case the conversion from packets to time becomes trivial...
wil
On Mon, Dec 13, 2010 at 6:41 PM, Torsten Curdt
<email@hidden> wrote:
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
--
Products and services:
http://flagpig.comBlog:
http://flagpig.tumblr.com
_______________________________________________
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