播放音乐
来源:互联网 发布:4g卡显示2g网络能用吗 编辑:程序博客网 时间:2024/05/03 12:47
-(void)playVideo:(NSString *)path{
NSURL *url=[NSURLfileURLWithPath:path];
_player = [[AVAudioPlayeralloc] initWithContentsOfURL:urlerror:nil];
//声明一个id
SystemSoundID numberID=0;
//创建系统播放
AudioServicesCreateSystemSoundID((__bridgeCFURLRef _Nonnull) (url), &numberID);
//添加注册
AudioServicesAddSystemSoundCompletion(numberID,NULL, NULL,soundCompleteCallBack, NULL);
//播放
AudioServicesPlayAlertSound(numberID);
}
-void soundCompleteCallBack(SystemSoundID soundID,void *clientData){
NSLog(@"播放完成。。。。");
}
0 0
- 播放音乐
- 播放音乐
- 音乐播放
- 播放音乐
- 音乐播放
- 播放音乐
- 播放音乐
- 音乐播放
- 播放音乐
- 播放音乐
- 音乐播放
- 音乐播放
- 音乐播放
- 音乐播放
- 音乐播放
- 播放音乐
- 音乐播放
- 音乐播放
- mybatis学习 - 多表查询的实现
- PHP语法基础部分
- hdu 5744 Keep On Movin
- jsp放在web-inf下的注意事项
- 51单片机驱动1602显示万年历
- 播放音乐
- 2016Bytecup之菜鸟进阶
- leetcode(85).383. Ransom Note
- < %=request.getParameter(“username”)% > 等价于 ${ param.username }
- Bloom Filter概念和原理
- 26. Remove Duplicates from Sorted Array
- 394. Decode String
- C/C++指向指针的指针
- Opencv+VS2010同时打开三路摄像头源代码及各类问题分析