控制振动 [英] taking control on vibration

查看:66
本文介绍了控制振动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道这是我们用来使设备振动的方法:

I know this is what we use to make the device vibrate:

#import <AudioToolbox/AudioToolbox.h>

AudioServicesPlaySystemSound (kSystemSoundID_Vibrate);

但是如何停止振动? 我的意思是,我想要一个可激活或停用振动的开关.

But how do I stop the vibration? I mean, I want a switch which activates or deactivates the vibration.

我该怎么做?

推荐答案

使用AudioServicesPlaySystemSound()时,无法知道声音何时停止播放.对于振动,我认为这是固定长度的动作,我认为您不能在演奏过程中停止它.

When you use AudioServicesPlaySystemSound() there's no way to know when the sound has stopped playing. For a vibration, I believe it's a fixed length action and I don't think you can stop it in the middle of its playing.

这篇关于控制振动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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