问题
I want to add audio player in my app.I have no idea about it. I want to play songs and make playlist also...how can i do this?
回答1:
You can find tutorial from the following link:- http://mobileorchard.com/easy-audio-playback-with-avaudioplayer/
or
http://psychicparrotgames.com/?p=33
or
http://www.codeproject.com/KB/iPhone/abPlayer_iPhone.aspx
Hope it helps you.
回答2:
go through following links, it will help you -
http://mobileorchard.com/easy-audio-playback-with-avaudioplayer/
http://mobile.tutsplus.com/tutorials/iphone/ios-sdk_background-audio/
回答3:
do as below.
#import <AVFoundation/AVFoundation.h>
NSString *musicFilePath = [[NSBundle mainBundle] pathForResource:@"sample" ofType:@"mp3"];
NSURL *musicURL = [[NSURL alloc] initFileURLWithPath:musicFilePath];
AVAudioPlayer *player = [[AVAudioPlayer alloc] initWithContentsOfURL:musicURL error:nil];
[player prepareToPlay];
[player play];
来源:https://stackoverflow.com/questions/8889645/how-can-i-add-audio-player-in-iphone-app