![iphone-os3 iphone-os3](https://i-blog.csdnimg.cn/blog_migrate/ee66f0ca6f733d0bf3ec6c5e74bad489.png)
If you’re using compressed audio in your iPhone game, then you should grab Unity iPhone 1.0.3. It is a hot fix release with a single purpose – to improve performance of a compressed audio playback under the iPhone OS 3.0.
如果您在iPhone游戏中使用压缩音频,则应使用Unity iPhone 1.0.3 。 它是一个具有一个单一目的的热修复程序版本-改善iPhone OS 3.0下压缩音频播放的性能。
Now some technical bits. Previously we have been using the AmbientSound as an audio session category. The AmbientSound category respects silent switch and allows single compressed audio to be played via dedicated hardware decompressor. However since introduction of the iPhone OS 3.0 meaning of the AmbientSound slightly changed. Now this category allows multiple compressed audio sounds to be played, but all of them are decompressed on CPU!
现在介绍一些技术知识。 以前,我们一直使用AmbientSound作为音频会话类别。 AmbientSound类别涉及静音开关,并允许通过专用硬件解压缩器播放单个压缩的音频。 但是,自从引入iPhone OS 3.0以来, AmbientSound的含义就略有变化。 现在,此类别允许播放多个压缩的音频声音, 但是所有这些声音都在CPU上解压缩了!
That is not a big deal if you have game without CPU intensive tasks or completely GPU bound game. Otherwise performance may suffer. Instead iPhone OS 3.0 introduced a new audio session category called AmbientSoundSolo which behavior is more like an AmbientSound under the OS 2.x. That is what we need!
如果您的游戏没有CPU密集型任务或完全受GPU约束的游戏,那没什么大不了的。 否则可能会影响性能。 相反,iPhone OS 3.0引入了一个新的音频会话类别,称为AmbientSoundSolo ,其行为更类似于OS 2.x下的AmbientSound 。 那就是我们所需要的!
Unity iPhone 1.0.3 will detect OS version at the run-time and will pick audio session category for you. It is important to know that this process does NOT require you to explicitly compile for newer OS version. You should use the OS 2.x as a compile target still – it will guarantee wider audience for your game.
Unity iPhone 1.0.3将在运行时检测操作系统版本,并为您选择音频会话类别。 重要的是要知道,此过程不需要您为较新的OS版本进行显式编译。 您仍应将OS 2.x用作编译目标 -这将确保您的游戏有更广泛的受众。
翻译自: https://blogs.unity3d.com/2009/06/17/iphone-103-to-the-rescue/