创建SystemSoundID数组的步骤如下:
AudioServicesCreateSystemSoundID((__bridge CFURLRef)NSURL fileURLWithPath:soundFile1, &soundIDs0);
AudioServicesCreateSystemSoundID((__bridge CFURLRef)NSURL fileURLWithPath:soundFile2, &soundIDs1);
AudioServicesCreateSystemSoundID((__bridge CFURLRef)NSURL fileURLWithPath:soundFile3, &soundIDs2);
创建SystemSoundID数组的优势是可以一次性加载多个音频文件,并且可以在需要的时候快速播放,适用于需要频繁播放不同音频的场景,例如游戏中的音效管理。
腾讯云相关产品和产品介绍链接地址:
云+社区沙龙online
云+社区沙龙online [技术应变力]
高校公开课
Elastic 实战工作坊
Elastic 实战工作坊
云原生正发声
云+社区技术沙龙[第27期]
北极星训练营
数字化产业研学会第一期
云+社区开发者大会 长沙站
领取专属 10元无门槛券
手把手带您无忧上云