Latest 1.0
License MIT
Platforms ios 8.0, osx 10.8, tvos 9.0, requires ARC
Frameworks AVFoundation



NPAudioStream is a lightweight Objective-C library to continuously stream a playlist of audio on iOS, tvOS, and macOS. NPAudioStream excels at maintaining audio playback over a poor network connection.


  • Audio controls represent the most common music interface behaviors (e.g. play, pause, skip, seek, shuffle).
  • Array/index style of url management elegantly binds to table view selection.
  • Optionally prebuffer the next track, even when shuffling.
  • Detect when a source is not streamable and automatically skip to the next song in the stream.
  • Repeat functionality supports one track or the whole stream.
  • Shuffle functionality mimics iPod behavior.

iOS only

  • Manages background tasks to ensure your app remains active during network interruptions
  • Pauses and resumes playback in response to a phone call interruption



The recommended method of installation is through CocoaPods. Add the following line to your Podfile, then run pod install.


pod 'NPAudioStream', '~> 1.0'

For iOS, be sure to add support for background audio as well.

Manual Installation

  1. Download NPAudioStream
  2. Drag the NPAudioStream directory into your Xcode project, and ensure the files are copied into your project’s directory.
  3. In your Xcode project, navigate to Target > Build Phases > Link Binary with Libraries and add the AVFoundation framework.
  4. For iOS, be sure to add support for background audio.

Basic Example

The simplest usage of NPAudioStream involves creating an instance, populating the urls property, then selecting an index for playback. NPAudioStream was built with the intention of streaming SoundCloud audio, so the following example demonstrates how to stream an array of SoundCloud URLs on iOS.

Note: Be sure to replace YOUR_CLIENT_ID with your own SoundCloud Client ID.


#import "NPAudioStream.h"

@implementation AppDelegate {
    NPAudioStream *audioStream;

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

    audioStream = [NPAudioStream new];

    NSArray *urlStrings = @[@"",

    NSMutableArray *urls = [NSMutableArray arrayWithCapacity:urlStrings.count];

    // append SoundCloud Client ID and create NSURL objects
    for (NSString *urlString in urlStrings) {
        NSString *streamURLString = [NSString stringWithFormat:@"%@?client_id=YOUR_CLIENT_ID", urlString];
        NSURL *url = [NSURL URLWithString:streamURLString];
        [urls addObject:url];

    [audioStream setUrls:urls];
    [audioStream selectIndexForPlayback:0];

    return YES;


Example Projects

NPAudioStream includes a workspace with two example projects – one for macOS and one for iOS (tvOS coming later). These projects showcase the most common patterns to build a music interface.

Add your SoundCloud Client ID

These examples use SoundCloud URLs, thus a SoundCloud Client ID is required. In the root directory, duplicate the file named keys-example.json, rename the new file to keys.json, then add your SC Client ID to keys.json.

Device support

NPAudioStream supports iOS 8.0+, tvOS 9.0+, and macOS 10.8+.


NPAudioStream is created and maintained by Alex Givens for Noon Pacific – the chillest way to discover new music every Monday 🌴

NPAudioStream is released under the MIT license. See LICENSE for details.

Latest podspec

    "name": "NPAudioStream",
    "version": "1.0",
    "license": "MIT",
    "summary": "NPAudioStream is a lightweight Objective-C library used to continuously stream a playlist of audio.",
    "homepage": "",
    "social_media_url": "",
    "authors": {
        "Alex Givens": "[email protected]"
    "source": {
        "git": "",
        "tag": "1.0"
    "requires_arc": true,
    "platforms": {
        "ios": "8.0",
        "osx": "10.8",
        "tvos": "9.0"
    "public_header_files": "NPAudioStream/*.h",
    "source_files": [
    "ios": {
        "source_files": "NPAudioStream/Categories/UIAlertView+Extensions.{h,m}"
    "frameworks": "AVFoundation"

Pin It on Pinterest

Share This