KSAudioPlayer 0.0.4

查看KSAudioPlayer 0.0.4

测试已测试
Lang语言 Obj-CObjective C
许可证 MIT
发布最后发布2014 年 12 月

Serg Krivoblotsky 维护。



查看KSAudioPlayer 0.0.4

  • Serg Krivoblotsky

基于 BASS-library 构建的 iOS 音频播放器。

支持的格式

支持的格式包括:*.m4a, *.mp3, *.mp2, *.mp1, *.ogg, *.wav, *.aiff, *.opus, *.flac, *.wv. 以及更多我还没有测试的格式。

极简界面

播放

- (BOOL)playItemWithURL:(NSURL *)url;

暂停

- (void)pause;

继续播放

- (void)resume;

正在播放吗?

- (BOOL)isPlaying;

获取当前曲目时长

- (NSTimeInterval)duration;

获取当前曲目位置

- (NSTimeInterval)position;

获取和设置音量

//0..1
@property (nonatomic, assign) CGFloat volume;

极简协议

/*
 Will be called when track is over
 */

- (void)playerDidFinishPlaying:(KSAudioPlayer *)player;

/*
 Will be called when interruption occured.
 For ex. phone call.
 Basically you should call - (void)pause in this case.
 */

- (void)playerBeginInterruption:(KSAudioPlayer *)player;

/*
 Will be called when interruption ended.
 For ex. phone call ended.
 It's up to you to decide to call - (void)resume or not.
 */

- (void)playerEndInterruption:(KSAudioPlayer *)player shouldResume:(BOOL)should;

集成

  1. 将 KSAudioPlayer 文件夹拖放到您的项目中。
  2. 将 AVFoundation.framework 添加到您的项目中
  3. 实例化 KSAudioPlayer 并享受乐趣
NSURL *fileURL = [[NSBundle mainBundle] URLForResource:@"Meat Loaf - Dead Ringer" withExtension:@"wv"];

self.player = [KSAudioPlayer new];
[self.player playItemWithURL:fileURL];

BASS

BASS 是用于多个平台软件的一个音频库。它的目的是为开发者提供强大的 efficient sample、stream(MP3、MP2、MP1、OGG、WAV、AIFF、自定义生成、以及通过 OS 编码器和附加组件更多),MOD 音乐(XM、IT、S3M、MOD、MTM、UMX),MO3 音乐(MP3/OGG 压缩 MODs),以及录音功能。所有这些都在一个紧凑的 DLL 中,而不会使您的发行版膨胀。

http://www.un4seen.com

http://www.un4seen.com/bass.html#license

接下来是什么?

  1. 跳转到时间。
  2. 在线流媒体。

请随意打开问题和拉取请求。或者给我发邮件 [email protected]