WAV:无损
MP3:流行
MIDI:作曲家最爱
WMA:最具实力
-(void)viewDidLoad
{
[superviewDidLoad];
self.view.backgroundColor = [UIColor whiteColor];
dispatch_queue_t dispatchQueue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT,0);
dispatch_async(dispatchQueue,^(void){
NSString*filePath = [[NSBundlemainBundle] pathForResource:@"Test" ofType:@"mp3"];
NSData* data= [NSData dataWithContentsOfFile:filePath];
NSError*error = nil;
self.audioPlay = [[AVAudioPlayer alloc] initWithData:data error:&error];
if(_audioPlay != nil) {
self.audioPlay.delegate = self;
} else {
NSLog(@"Error");
NSLog(@"%@", error.description);
}
});
// Do any additional setup after loadingthe view.
}
利用AsyncSocket进行数据传输,,,如果对数据要求不高可以用AsyncUdpSocket