[翻譯] OrigamiEngine

OrigamiEnginehtml

https://github.com/ap4y/OrigamiEnginegit

 

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

輕量級iOS,OSX音頻處理工具,支持opus, flac, cue, mp3, m4a, m3uapi

 

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 支持播放列表

 

Featuresapp

  • 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.async

提供靜態庫或者cocoapods.靜態庫可用來編譯嵌入FLAC的庫,在OSX上,你可使用靜態庫.ide

 

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
相關文章
相關標籤/搜索