Movie The ringer用の小さなサウンドボードアプリを書いています.iPhone SDKは初めてです
次のコードですべてのボタンを Mp3 ファイルにリンクしましたが、一部のボタンだけがサウンドを再生しますか?
すべてのファイル名を確認しましたが、それらはすべてコードと一致しています。
- (IBAction)canWeBeAlone:(id)sender {
CFBundleRef mainBundle = CFBundleGetMainBundle();
CFURLRef soundfileURLRef;
soundfileURLRef = CFBundleCopyResourceURL(mainBundle, (CFStringRef) @"Can We Be Alone", CFSTR ("mp3"), NULL);
UInt32 soundID;
AudioServicesCreateSystemSoundID (soundfileURLRef, &soundID);
AudioServicesPlaySystemSound(soundID);
}
- (IBAction)itsThreeAM:(id)sender {
CFBundleRef mainBundle = CFBundleGetMainBundle();
CFURLRef soundfileURLRef;
soundfileURLRef = CFBundleCopyResourceURL(mainBundle, (CFStringRef) @"Its 3AM", CFSTR ("mp3"), NULL);
UInt32 soundID;
AudioServicesCreateSystemSoundID (soundfileURLRef, &soundID);
AudioServicesPlaySystemSound(soundID);
}
- (IBAction)iHaveSinned:(id)sender {
CFBundleRef mainBundle = CFBundleGetMainBundle();
CFURLRef soundfileURLRef;
soundfileURLRef = CFBundleCopyResourceURL(mainBundle, (CFStringRef) @"I Have Sinned", CFSTR ("mp3"), NULL);
UInt32 soundID;
AudioServicesCreateSystemSoundID (soundfileURLRef, &soundID);
AudioServicesPlaySystemSound(soundID);
}
- (IBAction)mowMyLawn:(id)sender {
CFBundleRef mainBundle = CFBundleGetMainBundle();
CFURLRef soundfileURLRef;
soundfileURLRef = CFBundleCopyResourceURL(mainBundle, (CFStringRef) @"Mow My Lawn", CFSTR ("mp3"), NULL);
UInt32 soundID;
AudioServicesCreateSystemSoundID (soundfileURLRef, &soundID);
AudioServicesPlaySystemSound(soundID);
}
- (IBAction)theyAreMyFriends:(id)sender {
CFBundleRef mainBundle = CFBundleGetMainBundle();
CFURLRef soundfileURLRef;
soundfileURLRef = CFBundleCopyResourceURL(mainBundle, (CFStringRef) @"They Are My Friends", CFSTR ("mp3"), NULL);
UInt32 soundID;
AudioServicesCreateSystemSoundID (soundfileURLRef, &soundID);
AudioServicesPlaySystemSound(soundID);
}
- (IBAction)itsSteve:(id)sender {
CFBundleRef mainBundle = CFBundleGetMainBundle();
CFURLRef soundfileURLRef;
soundfileURLRef = CFBundleCopyResourceURL(mainBundle, (CFStringRef) @"Its Not Jeffy Its Steve", CFSTR ("mp3"), NULL);
UInt32 soundID;
AudioServicesCreateSystemSoundID (soundfileURLRef, &soundID);
AudioServicesPlaySystemSound(soundID);
}
- (IBAction)itWasWrongOfMe:(id)sender {
CFBundleRef mainBundle = CFBundleGetMainBundle();
CFURLRef soundfileURLRef;
soundfileURLRef = CFBundleCopyResourceURL(mainBundle, (CFStringRef) @"It Was Wrong of Me", CFSTR ("mp3"), NULL);
UInt32 soundID;
AudioServicesCreateSystemSoundID (soundfileURLRef, &soundID);
AudioServicesPlaySystemSound(soundID);
}
どんな助けでも大歓迎です