English 中文(简体)
声望
原标题:iPhone vibration while playing audio

我的申请使用音频Queue和音频Session。 我可以停止根据申请工作。 目前,我的客户要求我根据某些条件进行人工清扫。 我试图以音像服务公司作为音响或警示声来做。 没有积极成果。 有些人能否帮助我,告诉如何执行? 申请非监狱破碎的蜂窝的法律,并且由于 Apple果可以拒绝申请,因此可以使用习惯的蒸.。

谢谢。

问题回答

利用这一解决办法解决问题:

AVAudioSession *audioSession = [AVAudioSession sharedInstance];
NSError *err = nil;         
[audioSession setCategory :AVAudioSessionCategoryPlayback  error:&err];         
AudioServicesPlaySystemSound (kSystemSoundID_Vibrate);
[audioSession setCategory :AVAudioSessionCategoryPlayAndRecord  error:&err];

This is how I get the vibration:

#import <AudioTool Box/AudioTool Box.h>

AVAudioSession *audioSession = [AVAudioSession sharedInstance];
NSError *err = nil;         
[audioSession setCategory :AVAudioSessionCategoryPlayback  error:&err];         
AudioServicesPlaySystemSound (kSystemSoundID_Vibrate);

希望会有助于

For reference, I m not using AudioQueue but an AVAudioEngine to record something, and for my case I pinpointed it down to having to pause the input in order to play the vibration properly with AudioServicesPlaySystemSound during a record session.

因此,我就这样说了。

audioEngine?.pause()
AudioServicesPlaySystemSound(1519)
do {
  try audioEngine.start()
} catch let error {
  print("An error occurred starting audio engine. (error.localizedDescription)")
}




相关问题
Playing a Sound With Monotouch

No matter what I try (build -> content, NSUrl, filename) I get a null exception : file not found when I try to play a .caf sound file in monotouch. //var path = NSBundle.MainBundle.PathForResource("...

将音频Clips从Peter改为服务器

我不禁要问,那里是否有任何实例表明从Peit向服务器发送音响。 I m不关心电话或SIP风格的解决办法,只是一个简单的袖珍流程......

Play sound in iPhone web app with Javascript?

I m currently creating an iPhone web application for piano chords, and I wanted to add an option that would let the user press a Play button and play the selected chord. However, I m not sure how to ...

热门标签