Giter Site home page Giter Site logo

audjustable's Introduction

Audjustable Audio Streamer

Homepage

Audjustable is an audio streaming class for iOS and OSX. Audjustable uses CoreAudio to decompress and playback audio whilst providing a clean and simple object-oriented API.

The primary motivation of this project was to decouple the input (DataSource/InputStreams) from the actual player logic in order to allow advanced customizable input handling such as: HTTP streaming, encryption, auto-recovery, dynamic-buffering. Along the way other features such as gapless playback were added as the opportunity arose.

Features

  • Simple OOP API
  • Easy to read source
  • Adjustable audio buffering
  • Mostly asynchronous API
  • Buffered and gapless playback
  • Easy to implement audio data sources (HTTP and local file system DataSources provided)
  • Easy to extend DataSource to support adaptive buffering, encryption, etc.
  • Optimised for low CPU/battery usage

Usage

Download the source which includes a simple audio player project that streams audio over HTTP or locally using the HttpDataSource or LocalFileDataSource classes respectively.

If you would like to integrate the AudioPlayer directly into your project you only need to copy the files inside the /Audjustable/Classes/AudioPlayer directory into your project.

Audjustable is also available as a Cocoapod.

Code

There are two main classes. The DataSource class which is the abstract base class for the various compressed audio data sources (HTTP, local file are provided). The AudioPlayer class manages and renders audio from a queue DataSources.

// Create AudioPlayer

AudioPlayer* audioPlayer = [[AudioPlayer alloc] init];
audioPlayer.delegate = self;

// Queue on a URL to play. Each queue item has a unique ID (item1) that to identify the related file in delegate callbacks

[audioPlayer setDataSource:[audioPlayer dataSourceFromURL:@"https://github.com/downloads/tumtumtum/audjustable/sample.m4a"] withQueueItemId:@"item1"];

Other

Background playback on iOS is easily added to your application by calling the AudioSessionInitialize in your AppDelegate.

Authors and Contributors

Copyright 2012, Thong Nguyen (@tumtumtum)

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.