How can I Add Audio Player in iphone App

穿精又带淫゛_ 提交于 2020-01-14 06:50:11

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!