私は常にオーディオ ツールボックスを使用してサウンドを再生してきましたが、ユーザーはサウンドがないと言っています。これは、サイレント モードでは再生されないためです。代わりに av ファンデーションに交換しようと何度も試みましたが、うまくいきません。これは私が今使用しようとしているコードです:
- (IBAction)soundbutton:(id)sender {
NSString *path = [[NSBundle mainBundle] pathForResource:@"EASPORTS" ofType:@"mp3"];
AVAudioPlayer * theAudio=[[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:path] error:NULL];
[theAudio play];}