Coder Social home page Coder Social logo

dudongge / streamingkit Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tumtumtum/streamingkit

0.0 2.0 0.0 4.91 MB

A fast and extensible gapless AudioPlayer/AudioStreamer for OSX and iOS (iPhone, iPad)

License: Other

Objective-C 99.61% Ruby 0.39%

streamingkit's Introduction

StreamingKit

StreamingKit (formally Audjustable) is an audio playback and streaming library for iOS and Mac OSX. StreamingKit uses CoreAudio to decompress and playback audio (using hardware or software codecs) whilst providing a clean and simple object-oriented API.

The primary motivation of this project was to decouple the input data sources from the actual player logic in order to allow advanced customizable input handling such as HTTP progressive download based streaming, encryption/decryption, auto-recovery, dynamic-buffering. StreamingKit is the only streaming and playback library that supports dead-easy gapless playback between audio files of differing formats.

Main Features

  • Free OSS.
  • Simple API.
  • Easy to read source.
  • Carefully multi-threaded to provide a responsive API that won't block your UI thread nor starve the audio buffers.
  • Buffered and gapless playback between all format types.
  • Easy to implement audio data sources (Local, HTTP, AutoRecoveringHTTP DataSources are provided).
  • Easy to extend DataSource to support adaptive buffering, encryption, etc.
  • Optimised for low CPU/battery usage (0% - 1% CPU usage when streaming).
  • Optimised for linear data sources. Random access sources are required only for seeking.
  • StreamingKit 0.2.0 uses the AudioUnit API rather than the slower AudioQueues API which allows real-time interception of the raw PCM data for features such as level metering, EQ, etc.
  • Power metering
  • Inbuilt equalizer/EQ (iOS 5.0 and above, OSX 10.9 Mavericks and above) with support for dynamically changing/enabling/disabling EQ while playing.
  • Example apps for iOS and Mac OSX provided.

Installation

StreamingKit is available as a Cocoapod. You can also simply copy all the source files located inside StreamingKit/StreamingKit/* into your Xcode project.

Example

There are two main classes. The STKDataSource class which is the abstract base class for the various compressed audio data sources. The STKAudioPlayer class manages and renders audio from a queue DataSources. By default STKAudioPlayer will automatically parse URLs and create the appropriate data source internally.

Play an MP3 over HTTP

STKAudioPlayer* audioPlayer = [[STKAudioPlayer alloc] init];

[audioPlayer play:@"http://www.abstractpath.com/files/audiosamples/sample.mp3"];

Gapless playback

STKAudioPlayer* audioPlayer = [[STKAudioPlayer alloc] init];

[audioPlayer queue:@"http://www.abstractpath.com/files/audiosamples/sample.mp3"];
[audioPlayer queue:@"http://www.abstractpath.com/files/audiosamples/airplane.aac"];

Intercept PCM data just before its played

[audioPlayer appendFrameFilterWithName:@"MyCustomFilter" block:^(UInt32 channelsPerFrame, UInt32 bytesPerFrame, UInt32 frameCount, void* frames)
{
   ...
}];

More

More documentation is available on the project Wiki

Authors and Contributors

Copyright (c) 2012-2014, Thong Nguyen (@tumtumtum)

streamingkit's People

Contributors

tumtumtum avatar derpoliuk avatar danielgindi avatar ablinov avatar atlithorn avatar johnboiles avatar kwillick avatar kampfgnu avatar abuharsky avatar corprew avatar obrhoff avatar ravenwang avatar reindernijhoff avatar richardgroves avatar sergiou87 avatar haritowa avatar terryso avatar

Watchers

James Cloos avatar 东阁堂主 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.