[翻译] OrigamiEngine

简介:

OrigamiEngine

https://github.com/ap4y/OrigamiEngine

 

Lightweight iOS and OSX audio engine with opus, flac, cue, mp3, m4a, m3u support.

轻量级iOS,OSX音频处理工具,支持opus, flac, cue, mp3, m4a, m3u

 

Supported formats

  • Audio sources: http and local files 支持http方式以及本地文件方式
  • Audio files: opus, flac, mp3, m4a, wav and other from CoreAudio 支持的文件格式包括opus, flac, mp3, m4a, wav以及其他CoreAudio支持的类型
  • Playlists: cue, m3u 支持播放列表

 

Features

  • Ligthweight: 300kb compiled, 1.2mb with libFLAC 轻量级:编译后是300kb,链接到libFLAC后是1.2mb
  • Small memory foorprint: no more than 2.5mb for the flac files 占用内存小:flac文件不会超过2.5mb
  • Low resource consumption: about 14% CPU usage for FLAC on ipod 4g 低资源消耗:在ipod 4g上只用到了14%的CPU
  • All operations in background with GCD 所有后台操作基于GCD
  • Event-based (using dispatch sources and CoreAudio async api) 事件触发机制(使用了dispatch source以及CoreAudio 异步的api)
  • Provides full audio metadata (vorbis, id3 tags) with embeeded cover images 提供全部的音频元数据包括嵌入的图片资源
  • HTTP data caching HTTP数据缓存
  • Tested (currently about 85% code coverage) 已经测试过了(当前超过85%已经测试过)

 

Overview

Static library and cocoapods podspec provided. Static library can be compiled with embeeded FLAC library (check project targets). For OSX you can use static framework.

提供静态库或者cocoapods.静态库可用来编译嵌入FLAC的库,在OSX上,你可以使用静态库.

 

Start playback: 开始播放:

self.player = [[ORGMEngine alloc] init];
NSURL* url = [NSURL URLWithString:tfUrl.text];
[_player playUrl:url];

Common operations: 常用的操作:

[_player metadata];                         // current metadata
[_player pause];                            // pause playback
[_player resume];                           // resume playback
[_player stop];                             // stop playback
[_player seekToTime:seekSlider.value];      // seek to second
[_player setNextUrl:url withDataFlush:YES]; // play next track and clear current buffer

Delegate methods: 代理方法:

- (NSURL*)engineExpectsNextUrl:(ORGMEngine*)engine; // provides continious playback
- (void)engine:(ORGMEngine*)engine didChangeState:(ORGMEngineState)state; // state change callback

Check example project and tests for the additional information.

 

Documentation

Project headers contain appledoc comments, precompiled docset here.

工程头文件件中包含了appledoc的描述.

 

Tests

OCUnit tests included into the project.

 

Credits

  • http://cogx.org/ by Vincent Spader. FLAC decoder implementation based on Cog sources
目录
相关文章
|
XML Java Android开发
[翻译]IAdaptable是什么?
IAdaptable在Eclipse里是一个非常重要的接口。对于Eclipse开发老手来说,它就像异常处理和抽象类一样寻常;但是对新手而言,它却令人感到困惑和畏惧。这篇文章将向你解释IAdaptable到底是什么,以及它在Eclipse里起到的作用。
1213 0
|
iOS开发 编译器 Go
|
iOS开发 Android开发
|
API 对象存储 iOS开发
|
iOS开发 Perl