If the answer to the multiple option option is correct or false, then I want to play a different warning sound. I have the code for the correct and wrong answer, as is the following
if (question number == 1) {[self correct answer]; } If (question number == 2) {[wrong answer]; } I created the correct IBAction warning code. Can I make a simple drama under right or wrong answers? Alert statement?
If you want to use the default applet, use the code, and click on it Try different voices.
If you want to play custom sounds, the easiest way is to AVAudioPlayer : First of all, you AVFoundation framework is very easy to get from there: NSURL * url = [NSWR file URLWithPath: Path is Directory: Yes]; Aviadio player * sound = audio player [url]; NSError * Error = Zero; Sound = [[AVAudioPlayer alloc] initWithContentsOfURL: url error: & amp; Error]; [Sound play];
No comments:
Post a Comment