• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
time vs packets
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: time vs packets
      • From: Wil Macaulay <email@hidden>
  • Prev by Date: Re: Cocoa AU - stealing keys from Logic
  • Next by Date: Re: Biquad Filter in Audio Unit
  • Previous by thread: Re: Biquad Filter in Audio Unit
  • Next by thread: Re: time vs packets
  • Index(es):
    • Date
    • Thread