A LongAudioSource
object can be any kind of audio, not just music. In this recipe, we will use the metering technique to animate the mouth of the gregarious Senator Beauregard Claghorn.
#import "SimpleAudioEngine.h" @implementation Ch6_MeteringDialogue -(CCLayer*) runRecipe { /* CODE OMITTED */ //Add the sounds [self loadLongAudioSource:@"claghorn_a_joke_son.caf"]; [self loadLongAudioSource:@"claghorn_carolina.caf"]; /* CODE OMITTED */ //Add the background music [self loadBackgroundMusic:@"dixie_1916.mp3"]; /* CODE OMITTED */ //Play background music [self playBackgroundMusic:@"dixie_1916.mp3"]; //Have Claghorn introduce himself [self playLongAudioSource:@"claghorn_howdy.caf"]; } -(void) step:(ccTime)delta { /* CODE OMITTED */ [self setPeakAndAveragePower]; [self animateClaghorn]; }...