Sound signals from the Audio Toolbox are great for short asynchronous playback.
// Initialize CFBundleRef mainBundle; mainBundle = CFBundleGetMainBundle (); // Init each sound CFURLRef tapURL; SystemSoundID tapSound; tapURL = CFBundleCopyResourceURL(mainBundle, CFSTR("tap"), CFSTR("aif"), NULL); AudioServicesCreateSystemSoundID(tapURL, &tapSound); // Play the sound async AudioServicesPlaySystemSound(tapSound);
I do not have MP3 files to work with AudioServicesPlaySystemSound . But it plays AIF files perfectly.
source share