它是确定以混合AudioServicesPlaySystemSound和AVAudioPlayer? [英] Is it OK to mix AudioServicesPlaySystemSound and AVAudioPlayer?

查看:182
本文介绍了它是确定以混合AudioServicesPlaySystemSound和AVAudioPlayer?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个游戏,这是非常接近被释放,但我们有一个非常恼人的问题。一个在我们的Beta测试的手机,他听不到任何的游戏音效。他可以,但是,听到的背景音乐和标题画面的音乐就好了。

We have a game that is very close to being released, but we have one extremely annoying problem. One on of our Beta testers phones, he can't hear any of the in game sound effects. He can, however, hear the background music and the title screen music just fine.

的背景和标题音乐都经由AVAudioPlayer播放(它们是长,我们需要循环和音量控制等)。声音效果只是正与AudioServicesPlaySystemSound打(他们是很短的,我们并不需要precise控制或知道他们何时结束等)。这适用于大多数的iPhone,但不是在这一个。所有这一切都被打了AVAudioSessionCategorySoloAmbient的音频会话。

The background and title music are both being played via AVAudioPlayer (they are longer, we need looping and volume control, etc). The sound effects are simply being played with AudioServicesPlaySystemSound (they are very short, we don't need precise control or to know when they end, etc). This works on most iPhones, but not on this one. All of this is being played with an audio session of AVAudioSessionCategorySoloAmbient.

所以,我有两个问题:
  - 首先,这是一个可以接受的实现?即是有什么我错过了,说你不能混用这两个框架,或一个原因,它是一个坏主意混合使用?
  - 其次,有没有人见过这样的事情之前?如果是这样,你有没有找到变通的办法?

So I have two questions: - First, is this an acceptable implementation? i.e. is there something I missed that says you can't mix these two frameworks, or a reason why its a bad idea to mix them? - Second, has anyone seen something like this before? If so, did you find a way around it?

其他背景说明:我可以pretty得出结论说,他的手机上,这是两个框架的混合。他能够听到声音,直到大致在这里,我们添加了标题画面的音乐相同的生成。另外,如果我改变声音的一个通过AVAudioPlayer工作,他能听到它。不幸的是,我不能简单地声音进入AVAudioPlayers,因为它只是不都表现良好,我需要更好的同步。

Additional background note: I can pretty conclusively say that on his phone, it is the mixing of the two frameworks. He was able to hear sounds until roughly the same build where we added the title screen music. Also, if I change one of the sounds to work through an AVAudioPlayer, he's able to hear it. Unfortunately, I can't simply move the sounds into AVAudioPlayers because it just doesn't perform well at all, and I need better synchronization.

推荐答案

我在App Store两个应用程序混合了这两种框架。 AVAudioPlayer为需要启动和停止,音量控制和AudioServices工具箱短的蜂鸣声小和点击的声音。唯一觉得我能想到的,把我的头顶部,是AVAudioPlayer的体积似乎从AudioServices声音单独控制。因此,检查以确保测试仪不具有声音关闭(与振动模式开关)或者卷翻一路下滑。

I have two apps on the app store that mix those two frameworks. AVAudioPlayer for sounds that require start and stop and volume control and AudioServices toolbox for short little beeps and clicks. The only think I can think of, off the top of my head, is that the volume of AVAudioPlayer seems to be controlled separately from the AudioServices sounds. So check to make sure that the tester doesn't have sounds turned off (with the vibrate mode switch) or the volume turned way down.

如果这没有帮助,更告诉我你的声音/ code,我可以添加一些code到我的应用程序,看看我是否能得到相同的行为。当然,听起来像大部分的测试者没有这个问题,我可能不会看到。

If this doesn't help, tell me more about your sounds/code and I can add some code to my app to see if I can get the same behavior. Of course, sounds like most your testers don't have this problem, and I probably won't see it either.

这篇关于它是确定以混合AudioServicesPlaySystemSound和AVAudioPlayer?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆