APAudioPlayer 0.0.4

APAudioPlayer 0.0.4

测试已测试
语言语言 Obj-CObjective C
许可协议 MIT
发布时间最后发布2015年6月

Serg KrivoblotskyEvgeniy Gurtovoy 维护。



  • 作者:
  • Serg Krivoblotsky

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

支持的格式

/*.m4a, *.mp3, *.mp2, *.mp1, *.wave, *.ogg, *.wav, *.aiff, *.opus, *.flac, *.wv. ... 以及更多我尚未测试的格式。

简单的界面

播放

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

暂停

- (void)pause;

继续

- (void)resume;

是否正在播放?

- (BOOL)isPlaying;

获取当前曲目持续时间

- (NSTimeInterval)duration;

获取和设置当前曲目位置

/* Represents current position 0..1 */
@property (nonatomic, assign) CGFloat position;

获取和设置音量

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

简单的协议

/**
 *  Notifies the delegate about playing status changed
 *
 *  @param player APAudioPlayer
 */
- (void)playerDidChangePlayingStatus:(APAudioPlayer *)player;

/**
 *  Will be called when track is over
 *
 *  @param player APAudioPlayer
 */
- (void)playerDidFinishPlaying:(APAudioPlayer *)player;

/**
 *   Will be called when interruption occured. For ex. phone call. Basically you should call - (void)pause in this case.
 *
 *  @param player APAudioPlayer
 */
- (void)playerBeginInterruption:(APAudioPlayer *)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.
 *
 *  @param player APAudioPlayer
 *  @param should BOOL
 */
- (void)playerEndInterruption:(APAudioPlayer *)player shouldResume:(BOOL)should;

集成

Cocoapods

pod 'APAudioPlayer'

手动

  1. 将 APAudioPlaeyr 文件夹拖放到您的项目中。
  2. 将 AVFoundation.framework 添加到您的项目中
  3. 实例化 APAudioPlayer 并享受乐趣
//Somewhere during init
self.player = [APAudioPlayer new];

//Somewhere else
NSURL *fileURL = [[NSBundle mainBundle] URLForResource:@"Meat Loaf - Dead Ringer" withExtension:@"wv"];
[self.player playItemWithURL:fileURL];

例子

查看 示例 文件夹。

Screenshot

BASS

BASS 是一个用于多个平台软件的音频库。它的目的是为开发人员提供功能强大且高效的样本、流(MP3、MP2、MP1、OGG、WAV、AIFF、可通过 OS 编码器和附加组件生成等),MOD 音乐(XM、IT、S3M、MOD、MTM、UMX),MO3 音乐(MP3/OGG 压缩 MOD),以及录音功能。全部在一个紧凑的 DLL 中,不会使您的分发膨胀。

http://www.un4seen.com

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

接下来是什么?

  1. 在线流媒体。

联系方式

如果您有任何改进或问题,请随意提交 一个问题 并详细介绍。

查看 所有 Alterplay 的 GitHub 项目。 发邮件给我们,提供其他想法和项目。