-(IBAction)playSound{ AVAudioPlayer *myExampleSound;
NSString *myExamplePath = [[NSBundle mainBundle] pathForResource:@"myaudiofile" ofType:@"caf"];
myExampleSound =[[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:myExamplePath] error:NULL];
myExampleSound.delegate = self;
[myExampleSound play];
}
Je souhaite émettre un bip lorsque vous cliquez sur un bouton. J'avais utilisé le code ci-dessus. Mais il faut du temps pour jouer le son.Retarder la lecture des sons à l'aide de AVAudioPlayer
Quelqu'un s'il vous plaît aider.
thx, zoul, pour l'exemple de lien de code. – ohho
Mais vous ne pouvez pas contrôler le volume avec ceci. – arundevma
Pour autant que je sache, vous ne pouvez jouer qu'un seul son à la fois. – VagueExplanation