Playing a sound with AVAudioPlayer播放本地文件
来源:互联网 发布:2017中国云计算500强 编辑:程序博客网 时间:2024/06/08 08:13
#import <AVFoundation/AVFoundation.h>// Using the AVAudioPlayer to play a sound-(void)loadAndPreparePlayerWithURL:(NSURL *)url error:(NSError **)error{ // Create the player. Assumes player is an ivar of type AVAudioPlayer * player = [[AVAudioPlayer alloc] initWithContentsOfURL:url error:nil]; // Set properties player.delegate = self; // delegate // Get ready to play the sound [ player prepareToPlay ];}-(void)playThePlayer{ // Play ! [ player play ];}-(void)audioPlayerDidFinishPlaying:(AVAudioPlayer *)myPlayer successfully:(BOOL)flag{ if (flag==YES) [ myPlayer prepareToPlay ];}
- Playing a sound with AVAudioPlayer播放本地文件
- A. Playing with Dice
- A. Playing with Paper
- A. Playing with Paper
- A-Playing with Paper
- A-Playing with Paper
- 音频播放(System Sound Services、MPMusicPlayerController、AVAudioplayer) for IOS
- Playing a wave sound from a resource file
- zoj1537- Playing with a Calculator
- 527A. Playing with Paper
- 527A. Playing with Paper
- Tutorial 03: Playing Sound
- Tutorial 03: Playing Sound
- codeforces--12.29--A. Playing with Dice
- Codeforces 527A Playing with Paper
- 527A. Playing with Paper【math】
- CodeForces 527A Playing with Paper
- codeforces 527A Playing with Paper
- hibernate 主键指定不当造成的错误
- 浅析http协议
- 经典:从追MM谈Java的23种设计模式
- DP::Poj1088 滑雪
- curl源码分析(一)webkit中curl库的使用
- Playing a sound with AVAudioPlayer播放本地文件
- 内联排列的间距 和 浏览器对换行符理解成文本节点的原因研究
- SSI(Server Side Includeds)使用详解
- Struts2 无法导向到首页There is no Action mapped for namespace / and action name
- 写在最前面的...
- 排序算法
- C/C++源代码网
- Hacker Typer – 逼真黑客范儿
- 安装wi7的曲折