加入收藏 | 设为首页 | 会员中心 | 我要投稿 武汉站长网 (https://www.027zz.cn/)- 云连接、智能边缘云、数据快递、云手机、云日志!
当前位置: 首页 > 教程 > 正文

iOS代码构建无声音乐方法

发布时间:2023-11-04 10:30:26 所属栏目:教程 来源:未知
导读:   代码创建无声音乐方法



  const char bytes[] = {0x52, 0x49, 0x46, 0x46, 0x26, 0x0, 0x0, 0x0, 0x57, 0x41, 0x56, 0x45, 0x66, 0x6d, 0x74, 0x20, 0x10, 0x0, 0x0, 0x0, 0x1,
  代码创建无声音乐方法
 
  const char bytes[] = {0x52, 0x49, 0x46, 0x46, 0x26, 0x0, 0x0, 0x0, 0x57, 0x41, 0x56, 0x45, 0x66, 0x6d, 0x74, 0x20, 0x10, 0x0, 0x0, 0x0, 0x1, 0x0, 0x1, 0x0, 0x44, 0xac, 0x0, 0x0, 0x88, 0x58, 0x1, 0x0, 0x2, 0x0, 0x10, 0x0, 0x64, 0x61, 0x74, 0x61, 0x2, 0x0, 0x0, 0x0, 0xfc, 0xff};
 
      NSData* data = [NSData dataWithBytes:bytes length:sizeof(bytes)];
 
      NSString * docsDir = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES)[0];
 
      // Build the path to the database file
 
      NSString * filePath = [[NSString alloc] initWithString:
 
                             [docsDir stringByAppendingPathComponent: @"background.wav"]];
 
      [data writeToFile:filePath atomically:YES];
 

(编辑:武汉站长网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章