`
siruoxian
  • 浏览: 231094 次
  • 性别: Icon_minigender_2
  • 来自: 北京
社区版块
存档分类
最新评论

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];

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics