[翻译] 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
目录
相关文章
|
存储 自然语言处理 前端开发
从零写一个Recoil(翻译)
Rewriting Recoil from scratchrecoil是facebook编写的一个库,它之所以诞生是因为人体工程学、context的性能问题和useState。这是一个非常聪明的库,几乎每个人都会找到它的用途——如果你想了解更多,请查看这段解释视频。刚开始我被图论和recoil惊到了,但渐渐的理解后,感觉也没那么特别了。也许我也可以实现一个类似的东西。我自己实现的版本和recoil
195 0
从零写一个Recoil(翻译)
《Wir wilden weisen Frauen》翻译——<连载>
上周去逛图书馆,借了本德语原版的书。今天突然想起来了,就翻开来看。我不知道这本书是否有中文版的,不管有没有吧,我尝试翻译一下以提高自身的德语水平。每天花上一个半小时来翻译,我想应该不能翻译出来几句的。
765 0
|
iOS开发 Android开发
|
iOS开发 编译器 Go
|
iOS开发
|
Android开发 iOS开发 Perl