开发者

How i play Mp3 from server from avaudioplayer

开发者 https://www.devze.com 2022-12-31 13:26 出处:网络
I am new in iPhone,Anyone tell me ple开发者_如何转开发ase how i play audio uploaded on server.

I am new in iPhone,Anyone tell me ple开发者_如何转开发ase how i play audio uploaded on server. in my application some songs are from local and some others are from Server,Locally i play songs successfully but how i play a audio file from server from AVAudioplayer.

Thanks, Arun


As documented:

AVAudioPlayer *player = [AVAudioPlayer initWithContentsOfUrl:urlToAudioResource];
[player play];


http://github.com/mattgallagher/AudioStreamer


AVAudioPlayer plays file when it loads. To stream audio you should try use AVPlayer. It can play audio from web servers without UI freezing.

0

精彩评论

暂无评论...
验证码 换一张
取 消