0

In an iOS application, the minimum buffer duration of 4 milli seconds is required. But the Audio toolbox framework provides, 23 milli seconds for 16kHz, mono channel configuration. i.e. it gives 742/744 bytes at each input callback.

How to make the callback data size as, 128 bytes (4 milli seconds)?

Whether the internal mic (16kHz) or external mic (44.1 kHz) is used, the received callback size is 742/744 bytes (16kHz) only. Not clear about this behavior.

Whereas, in 'AudioUnit' framework, the callback data size gets corrupted, when an extenal mic (44.1 kHz) is connected.

JasonMArcher
  • 14,195
  • 22
  • 56
  • 52
ArunJTS
  • 264
  • 5
  • 15
  • I think what you need is to set kAudioSessionProperty_PreferredHardwareIOBufferDuration: https://developer.apple.com/library/ios/documentation/Audio/Conceptual/AudioSessionProgrammingGuide/Cookbook/Cookbook.html#//apple_ref/doc/uid/TP40007875-CH6-SW36 – user523234 Jan 08 '14 at 03:34
  • I have already tried the above settings. It is giving the following buffer sizes for the given buffer durations. second buffer size (bytes) 0.002 -> 46 0.003 -> 92 0.004 -> 92 0.005 -> 184 0.01 -> 370 0.02 -> 742 0.03 -> 742 0.04 -> 1486 0.05 -> 1486 0.06 -> 1486 0.07 -> 2972 0.08 -> 2972 0.09 -> 2972 0.1 -> 2972 But, not giving the expected buffer size. – ArunJTS Jan 08 '14 at 03:51

0 Answers0