本机iPhone音频格式 [英] Native iPhone audio format
问题描述
我目前得到了我的输出音频的iPhone设置为这样的:
I've currently got my output audio on the iPhone setup as this :
AudioStreamBasicDescription audioFormat;
audioFormat.mSampleRate = 48000;
audioFormat.mFormatID = kAudioFormatLinearPCM;
audioFormat.mFormatFlags = kAudioFormatFlagIsSignedInteger | kAudioFormatFlagIsPacked;
audioFormat.mFramesPerPacket = 1;
audioFormat.mChannelsPerFrame = 2;
audioFormat.mBitsPerChannel = 16;
audioFormat.mBytesPerPacket = 4;
audioFormat.mBytesPerFrame = 4;
然而,当我通过研究鲨鱼我的表现数字,我看到的功能,如: SRC_Convert_table_i32_scalar_stereo
需要很长时间公平块。
take a fair chunk of time.
这让我想到 - 什么是iPhone的理想和建议输出格式?需要为设备发挥工作尽可能少的人。
This made me think - what is the ideal and suggested output format for the iPhone? The one that requires as little work for the device to play.
推荐答案
鲨鱼确实与iPhone合作。您可以通过在菜单中选择取样>网络/ iPhone性能分析...让iPhone剖析。
Shark does work with the iPhone. You can enable iPhone profiling by selecting "Sampling > Network/iPhone Profiling..." in the menu.
肯定尝试使用44100 Hz的采样率。随着48000我看到你贴出现在调用堆栈相同的功能 - 使用时,44100在iPhone上的音频单元的规范音频格式非交错无此功能显示出来8.24线性PCM:
Definitely try using a 44100 Hz sampling rate. With 48000 I see the same function that you posted appearing in the callstacks -- no such function shows up when using 44100. The canonical audio format for Audio Units on the iPhone is non-interleaved 8.24 linear PCM:
streamFormat.mFormatID = kAudioFormatLinearPCM;
streamFormat.mFormatFlags =
kAudioFormatFlagIsSignedInteger
| kAudioFormatFlagsNativeEndian
| kLinearPCMFormatFlagIsNonInterleaved
| (24 << kLinearPCMFormatFlagsSampleFractionShift);
streamFormat.mSampleRate = mixing_rate;
streamFormat.mBitsPerChannel = 32;
streamFormat.mChannelsPerFrame = 2;
streamFormat.mFramesPerPacket = 1;
streamFormat.mBytesPerFrame = ( streamFormat.mBitsPerChannel / 8 );
streamFormat.mBytesPerPacket = streamFormat.mBytesPerFrame *
streamFormat.mFramesPerPacket;
这篇关于本机iPhone音频格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!