Gavin.han

致力于移动开发 技术改变生活
随笔 - 133, 文章 - 0, 评论 - 46, 阅读 - 42万

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

随笔分类 -  ios 音频

摘要:新建Empty Application,添加HomeViewControllerHomeViewController.h代码#import <UIKit/UIKit.h>#import <MediaPlayer/MediaPlayer.h>@interface HomeViewController : UIViewController{ MPMoviePlayerViewController *playerViewController;}- (IBAction)buttonClicked:(id)sender;@endHomeViewController.m代码#imp 阅读全文

posted @ 2012-10-31 13:20 gavin.han 阅读(447) 评论(0) 推荐(0) 编辑

摘要:新建Empty Applicaton,添加HomeViewController文件。还是看代码吧,将理论太枯燥,理论在代码中会提到。HomeViewController.h代码:#import <UIKit/UIKit.h>#import <AVFoundation/AVFoundation.h>@interface HomeViewController : UIViewController<AVAudioRecorderDelegate, AVAudioPlayerDelegate>{}@property (nonatomic, retain) AVAud 阅读全文

posted @ 2012-10-30 22:28 gavin.han 阅读(9306) 评论(0) 推荐(1) 编辑

摘要:ios 音频的播放使用到AVFoundation框架。其包含三个主要的类:AVAudioPlayer、AVAudioRecorder和AVAudioSession。它们负责音频的播放、录制和配置,而且都有相对应的delegate协议。支持的格式有:caf/m4a/mp3/aif/wav/au/snd/aac.能够提供基本的播放操作:创建、准备、播放、暂停、跳过和停止,并且支持多个AVAudioPlayer对象的使用。支持音量调节控制、循环播放和左右声道设置等。 AVAudioPlayerDelegate协议有以下重要方法: audioPlayerBeginInterruptio... 阅读全文

posted @ 2012-10-30 20:55 gavin.han 阅读(5258) 评论(1) 推荐(0) 编辑

点击右上角即可分享
微信分享提示