BugFixLog

作者: Bingle | 来源:发表于2015-04-27 20:00 被阅读0次

1. 简短的提示音,如果是用生成系统声音的方法,在用音量控制键调节音量时,有时会出现只能更改音量,而系统声音只受铃声音量大小影响,所以会导致音量无法调节情况:

NSString*path = [[NSBundlemainBundle] pathForResource:@"countdown"ofType:@"wav"];
AudioServicesCreateSystemSoundID((__bridge CFURLRef)[NSURL fileURLWithPath:path], &soundID);
AudioServicesPlaySystemSound(soundID);

修改为:

NSString *path = [[NSBundlemainBundle] pathForResource:@"countdown"ofType:@"wav"];
_player= [[AVAudioPlayeralloc] initWithContentsOfURL:[NSURLURLWithString:path]error:nil];
[_player setNumberOfLoops:0];
[_player prepareToPlay];
[_player play];```

相关文章

  • BugFixLog

    1. 简短的提示音,如果是用生成系统声音的方法,在用音量控制键调节音量时,有时会出现只能更改音量,而系统声音只受铃...

网友评论

      本文标题:BugFixLog

      本文链接:https://www.haomeiwen.com/subject/yafvfttx.html