小智 36
你可以使用AVAudioPlayer:
NSString *soundFilePath = [[NSBundle mainBundle] pathForResource:@"mySound" ofType:@"mp3"];
NSURL *soundFileURL = [NSURL fileURLWithPath:soundFilePath];
AVAudioPlayer *player = [[AVAudioPlayer alloc] initWithContentsOfURL:soundFileURL error:nil];
player.numberOfLoops = -1; //infinite
[player play];
Run Code Online (Sandbox Code Playgroud)
你可以通过设置currentTime:
player.currentTime = 10; //jump to 10th second
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
11270 次 |
| 最近记录: |