我想讀取MP3文件與AVAudioPlayer讀取MP3文件與AVAudioPlayer
#import <AVFoundation/AVFoundation.h>
AVAudioPlayer *player;
@property(retain,nonatomic) AVAudioPlayer *player;
@synthesize player
-(IBAction) lirepiste
{
NSString *file [email protected]"http://media.islamway.net/lessons/othymeen/40nowaweyya/1.mp3";
player = [[AVAudioPlayer alloc]initWithContentsOfURL:[NSURL URLWithString:file,error:nil];
[player play];
}
沒有錯誤沒有崩潰,但也沒有讀
我忘了將AVFoundation框架添加到我的項目中,對不起=) – 2013-01-15 08:50:59