zoukankan      html  css  js  c++  java
  • 调用系统震动 循环震动

    1、需要引入#import <AVFoundation/AVFoundation.h>头文件,

    2、在需要播放的地方添加:

        AudioServicesAddSystemSoundCompletion(kSystemSoundID_Vibrate, NULL, NULL, systemAudioCallback, NULL);

        AudioServicesPlaySystemSound(kSystemSoundID_Vibrate);

    解释:kSystemSoundID_Vibrate为系统提供的震动的ID。

            systemAudioCallback为回调函数,每次震动完成之后便会回调。

    void systemAudioCallback()

    {

        AudioServicesPlaySystemSound(kSystemSoundID_Vibrate);

    }//回调函数中从新调用震动。

    3、然后在其停止播放的地方调用:

      AudioServicesRemoveSystemSoundCompletion(kSystemSoundID_Vibrate);

  • 相关阅读:
    scrapy框架
    selenium解析
    xpath解析
    解析语法
    request-html-render
    牛逼的requests-html
    Beautifulsoup
    请求和响应
    reuqests请求
    Django文件上传下载与富文本编辑框
  • 原文地址:https://www.cnblogs.com/sgdkg/p/5787045.html
Copyright © 2011-2022 走看看