zoukankan      html  css  js  c++  java
  • 自定义程序搭建

    1---------------------------前置相机获取图片为左右翻转:使用下列方法能够兼容所有系统

       - (instancetype)initWithCGImage:(CGImageRef)cgImage scale:(CGFloat)scale orientation:(UIImageOrientation)orientation NS_AVAILABLE_IOS(4_0);

    2---------------------------能够同时播放两段音频音乐 :点我查看两种音乐播放

      第一段音乐播放: 使用avplayer进行播放//实测中使用喜马拉雅进行第一段播放

      第二段音乐播放: 使用系统音进行播放//系统音能够更换为自定音频

      //----------------------系统音播放:

        - (void)playBeep

        {

            SystemSoundID sound = kSystemSoundID_Vibrate;

            //使用系统铃声

            NSString *path = [NSString stringWithFormat:@"/System/Library/Audio/UISounds/%@.%@",@"new-mail",@"caf"];

            //使用自定义铃声

          //    NSString *path = [[NSBundle mainBundle] pathForResource:@"QRCodeRead"ofType:@"wav"]; //需将音频资源copy到项目<br>

            if (path) {

                OSStatus error = AudioServicesCreateSystemSoundID((__bridge CFURLRef)[NSURL fileURLWithPath:path],&sound);

                if (error != kAudioServicesNoError) {

                    sound = 0;

                }

            }

          AudioServicesPlaySystemSound(sound);//播放声音

          AudioServicesPlaySystemSound(kSystemSoundID_Vibrate);//静音模式下震动

        }

     

  • 相关阅读:
    [PY3]——内置数据结构(2)——元组及其常用操作
    [PY3]——内置数据结构(1)——列表及其常用操作
    [PY3]——基本语法
    session和cookie介绍以及session简单应用
    php中获取当前系统时间、时间戳
    ajax之XML简介
    Ajax练习题
    ajax语法
    JQUERY选中问题
    JSON
  • 原文地址:https://www.cnblogs.com/thxios/p/6652412.html
Copyright © 2011-2022 走看看