首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > 移动开发 >

AVAudioPlayer 施用小示例

2012-09-12 
AVAudioPlayer 应用小示例NSString *soundPath[[NSBundle mainBundle] pathForResource:NSLocalizedStrin

AVAudioPlayer 应用小示例

NSString *soundPath=[[NSBundle mainBundle] pathForResource:NSLocalizedStringFromTable([_dictionary objectForKey:@"sound"],[defaults stringForKey:@"language"],@"提示") ofType:@"mp3"];
??NSURL *soundUrl=[NSURL fileURLWithPath:soundPath];
??_player=[[AVAudioPlayer alloc] initWithContentsOfURL:soundUrl error:nil];

?

NSString *soundPath=[[NSBundle mainBundle] pathForResource:@"sound" ofType:@"mp3"];
??NSURL *soundUrl=[NSURL fileURLWithPath:soundPath];
??_player=[[AVAudioPlayer alloc] initWithContentsOfURL:soundUrl error:nil];

热点排行