[翻译] 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 bufferDelegate methods:?代理方法:
- (NSURL*)engineExpectsNextUrl:(ORGMEngine*)engine; // provides continious playback - (void)engine:(ORGMEngine*)engine didChangeState:(ORGMEngineState)state; // state change callbackCheck 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
總結
以上是生活随笔為你收集整理的[翻译] OrigamiEngine的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Swift中如何重新懒加载
- 下一篇: 扒一扒MathType不为人知的技巧