Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个应用程序,其中播放声音时帧速率会急剧下降。我AVAudioPlayer用来播放这些声音,并且在很短的时间内播放了许多声音。这些声音只是千字节的问题。有没有其他方法可以以更低的性能成本播放这些声音?
AVAudioPlayer
是的。在应用程序启动期间将音频文件异步读取到原始 PCM 数组中。然后使用音频单元 API,直接或通过音频混合器将样本复制到 RemoteIO 音频单元缓冲区回调。预混合和/或非重叠音频的性能开销极低。少量音频混合的开销会增加一点点。