I only get this
1667785316
1667785316
1667785316
Float32 preferredBufferSize = 0.005; // 5 millis buffer
UInt32 size = sizeof(preferredBufferSize);
AudioSessionGetProperty(kAudioSessionProperty_CurrentHardwareIOBufferDuration, &size,
&preferredBufferSize);
printf("\n%d", kAudioSessionProperty_CurrentHardwareIOBufferDuration);
如果
printf("\n%.4f", kAudioSessionProperty_CurrentHardwareIOBufferDuration);
我明白了
736204793259769514805539544958332881185808905380376591296729466482703872896792123284994544877461533270472921226586720994654163338779026978512060081697113376452636514975744.0000
736204793259769514805539544958332881185808905380376591296729466482703872896792123284994544877461533270472921226586720994654163338779026978512060081697113376452636514975744.0000
答案 0 :(得分:2)
您正在使用整数符号。请改用浮点数。
printf("\n%.4f", kAudioSessionProperty_CurrentHardwareIOBufferDuration);
答案 1 :(得分:1)
为什么要打印属性ID而不是值? 如果你想打印你的毫秒,你可以这样做:
Float32 currentBufferSize;
UInt32 size = sizeof(currentBufferSize);
AudioSessionGetProperty(kAudioSessionProperty_CurrentHardwareIOBufferDuration,
&size,
¤tBufferSize);
printf("\n%.4f", currentBufferSize);
答案 2 :(得分:0)
printf("\n%.4f", kAudioSessionProperty_CurrentHardwareIOBufferDuration);
如果要在32位浮点数上使用4位小数精度。如果你想要任意长度,请删除.4。
答案 3 :(得分:0)
%d
表示整数,使用%f
表示float或double。阅读String Format Specifiers。