• 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
Input/Output Audio Timestamps desynchronized
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Input/Output Audio Timestamps desynchronized


  • Subject: Input/Output Audio Timestamps desynchronized
  • From: Matteo Cortonesi <email@hidden>
  • Date: Sat, 16 Mar 2013 13:51:18 +0100

Hi,

I'm developing an iPhone app using CoreAudio and I have the requirements to know exactly the timestamp of a recorded audio sample, as well as the timestamp an audio sample will have when it's played back.

For this reason, I am using 2 callbacks:
- Record callback: output scope of the input element
- Playback callback: input scope of the output element.

In the record callback I'm able to get the timestamp of the first sample in the data by accessing the parameter inTimeStamp->mSampleTime. Same thing goes for the playback callback, except in this case I'd expect the timestamp value to correspond to the timestamp value of the first audio sample in the data.

It all works nice on iPhone 4S: the audio data is recorded, short after the record callback is called. After this, the playback callback. The difference between the 2 timestamps is reasonable: it's 704 samples (i'm using standard float PCM data format and an IO buffer duration of 256 samples).

Problem: On iPhone 5, the difference between input and output timestamps is of several samples, like 50'000'000! Corresponding to 20 min or so. The only way to solve this is restarting the iPhone 5. After this step the difference is 735 samples, similar to the one of iPhone 4S. It looks like after the iPhone 5 is on since a long time, the difference grows bigger and bigger.

I've also tried to set the "kAudioOutputUnitProperty_StartTimestampsAtZero" property on the global scope of the input and output element, but the samples don't start from zero! Is this normal?

Matteo
 _______________________________________________
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

  • Prev by Date: Apple plugins on MountainLion - extra windows created during parameter changes
  • Next by Date: Problems with iOS devices lacking a built-in microphone
  • Previous by thread: Apple plugins on MountainLion - extra windows created during parameter changes
  • Next by thread: Problems with iOS devices lacking a built-in microphone
  • Index(es):
    • Date
    • Thread