Streaming audio

In Chapter 1, Graphics, we used the MPMoviePlayerController class to play full motion video. In this recipe, we will use a similar technique to create a streaming audio player.

Streaming audio

Getting ready

Please refer to the project RecipeCollection02 for full working code of this recipe.

How to do it...

Link the MediaPlayer framework to your project. Now, execute the following code:

#import <MediaPlayer/MediaPlayer.h> #import "AppDelegate.h" @implementation Ch6_StreamingAudio -(CCLayer*) runRecipe { //Create music player buttons [[CCSpriteFrameCache sharedSpriteFrameCache] addSpriteFramesWithFile:@"music_player.plist"]; CCMenuItemSprite *prevItem ...

Get Cocos2d for iPhone 1 Game Development Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.