Subscribe ( )

iPhone Programming Tutorials

 

Forum

If you're new here, you may want to subscribe to my RSS feed. Thanks for visiting!

You must be logged in to post Login Register

Search 

Sound Help

User Post

2:44 pm
April 29, 2009


carl

Noob

posts 1

1

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


About the iCodeBlog forum

Currently Online:

5 Guests

Maximum Online: 44

Forums:

Groups: 2

Forums: 6

Topics: 320

Posts: 760

Members:

There are 680 members

There are 1 guests


Brandon has made 87 posts

Top Posters:

bobcubsfan - 54

crazyiez - 30

VertigoSol - 26

AdeC - 17

Uhu - 17

Administrator: Brandon | Moderators: VertigoSol


© - Version 3.1.4 (Build 357)