Created
November 29, 2012 08:45
-
-
Save sneakyness/4167639 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-(void) playMusic | |
{ | |
NSString *musicPath1 = [[NSBundle mainBundle] pathForResource:@"POL-stable-boy-short" ofType:@"wav"]; | |
NSString* musicPath2 = [[NSBundle mainBundle] pathForResource:@"POL-two-fat-gangsters-short" ofType:@"wav"]; | |
AVPlayerItem *firstMusicItem = [AVPlayerItem playerItemWithURL:[NSURL fileURLWithPath:musicPath1]]; | |
AVPlayerItem *secondMusicItem = [AVPlayerItem playerItemWithURL:[NSURL fileURLWithPath:musicPath2]]; | |
self.backgroundMusicPlayer = [AVQueuePlayer queuePlayerWithItems:[NSArray arrayWithObjects:firstMusicItem, secondMusicItem, nil]]; | |
for (;;) | |
{ | |
[self.backgroundMusicPlayer play]; | |
} | |
//__neeku__ plays the track nonstop in an infinite loop. | |
//backgroundMusic1.numberOfLoops = -1; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment