hi i have a soundboard its just a screen with about 8 buttons. each individual button will have its own sound which will be played upon button press There are a couple of ways i could play the sound, such as using SystemSound or AVAudioPlayer system sound so far seems have the quickest response times, avaudioplayer is quite slow, it cant keep up if the user taps on the buttons really fast, i created an audio player for each sound which was quite messy. this is how im playing the sounds at the moment the .h file
@interface MainScreenViewController : UIViewController <AVAudioPlayerDelegate, UITabBarControllerDelegate> {
AVAudioPlayer *player;
CFURLRef keNURL;
SystemSoundID keNObject;
//KE LOUD
CFURLRef keLURL;
SystemSoundID keLObject;
//GE NORMAL
CFURLRef geNURL;
SystemSoundID geNObject;
//GE LOUD
CFURLRef geLURL;
SystemSoundID geLObject;
//NA NORMAL
CFURLRef naNURL;
SystemSoundID naNObject;
//NA LOUD
CFURLRef naLURL;
SystemSoundID naLObject;
//RA
CFURLRef raURL;
SystemSoundID raObject;
//DAGGA CLICK
CFURLRef daCURL;
SystemSoundID daCObject;
//TILLI CLICK
CFURLRef tiCURL;
SystemSoundID tiCObject;
}
@property (nonatomic, retain) AVAudioPlayer *player;
@property (readwrite) CFURLRef keNURL;
@property (readonly) SystemSoundID keNObject;
@property (readwrite) CFURLRef keLURL;
@property (readonly) SystemSoundID keLObject;
@property (readwrite) CFURLRef geNURL;
@property (readonly) SystemSoundID geNObject;
@property (readwrite) CFURLRef geLURL;
@property (readonly) SystemSoundID geLObject;
@property (readwrite) CFURLRef naNURL;
@property (readonly) SystemSoundID naNObject;
@property (readwrite) CFURLRef naLURL;
@property (readonly) SystemSoundID naLObject;
@property (readwrite) CFURLRef raURL;
@property (readonly) SystemSoundID raObject;
@property (readwrite) CFURLRef daCURL;
@property (readonly) SystemSoundID daCObject;
@property (readwrite) CFURLRef tiCURL;
@property (readonly) SystemSoundID tiCObject;
}
then the actions that play the individual sounds
then the .m file, after importing the .h file and the right frame works and synthesizing all the variables, write the code for the action and this is whats in the individual actions.
-(IBAction)geSound{
AudioServicesPlaySystemSound (self.geNObject);
}
i just wanted to know if systemsound is the way forward for me to create a soundboard. thanks especially when the user will tap on the board really fast alternating between beats. . if not what is the best way to play the sound which responds really well?