My probe applet plays sound on the simulator, but not the device

advertisements

I am making a soundboard app on Xcode 4.2. When i run the app on the simulator, the sound plays fine. But, when i run it on the device, no sound will play. My code is below.

- (IBAction)awhaaa:(id)sender {

    CFBundleRef mainBundle = CFBundleGetMainBundle();
    CFURLRef soundFileURLRef;
    soundFileURLRef = CFBundleCopyResourceURL(mainBundle, (CFStringRef) @"awhaaa", CFSTR ("wav"),NULL);
    UInt32 soundID;
    AudioServicesCreateSystemSoundID(soundFileURLRef, &soundID);
    AudioServicesPlaySystemSound(soundID);
}


is the file really named awhaaa.wav? the simulator, since it's running on your mac, is case-insensitive. the phone is case-sensitive, so if the file is aWhaaa.WAV or awHAaA.wAv, it will work in the simulator but not on the device.