My “aif” sound file plays fine in my app but if I try to change and program the app to play a different sound file or even overwrite the current sound file with a newer version, it no longer plays? Lucky I keep a back-up because when I put the one that was working back, it still no longer plays so I go back to the back-up.
I hope someone can help, it's driving me crazy
Thanks,
Carl
/*
File: SysSoundViewController.m
*/
#import “SysSoundViewController.h”
@implementation SysSoundViewController
- (void) viewDidLoad {
[super viewDidLoad];
// Get the main bundle for the app
NSString *path = [[NSBundle mainBundle] pathForResource:@”tap” ofType:@”aif”];
AudioServicesCreateSystemSoundID((CFURLRef)[NSURL fileURLWithPathath], &soundID);
}
// Respond to a tap on the System Sound button
- (IBAction) playSystemSound {
AudioServicesPlaySystemSound (soundID);
UIImage *myImage1 =
[UIImage imageNamed:@"mouth1.png"] ;
UIImage *myImage3 =
[UIImage imageNamed:@"mouth3.png"] ;
UIImage *myImage4 =
[UIImage imageNamed:@"mouth4.png"] ;
UIImageView *myImageView =
[[UIImageView alloc]
initWithFrame : [[UIScreen
mainScreen] bounds]] ;
myImageView.animationImages =
[NSArray arrayWithObjects:myImage1,myImage3,myImage4,nil];
myImageView.animationDuration = .7;
myImageView.animationRepeatCount = 6;
[myImageView startAnimating];
[self.view addSubview:myImageView];
[myImageView release];
}
- (void) dealloc {
[SysSoundViewController release];
[super dealloc];
}
@end