测试已测试 | ✗ |
Lang语言 | Obj-CObjective C |
许可证 | MIT |
发布最后发布 | 2014 年 12 月 |
由 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;
NSURL *fileURL = [[NSBundle mainBundle] URLForResource:@"Meat Loaf - Dead Ringer" withExtension:@"wv"];
self.player = [KSAudioPlayer new];
[self.player playItemWithURL:fileURL];
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/bass.html#license
请随意打开问题和拉取请求。或者给我发邮件 [email protected]。