'soundID' undeclared

Discussion in 'iOS Programming' started by codenamecueball, Jun 26, 2010.

  1. codenamecueball macrumors regular

    Joined:
    Jul 28, 2009
    #1
    Hi there programming forum.

    I am currently writing an app which plays a sound when a picture is tapped or hit or whatever. The code I am using is here
    Code:
    - (IBAction)HighFive{
    	//Get the filename of the sound file:
    	NSString *path = [NSString stringWithFormat:@"%@%@",
    					  [[NSBundle mainBundle] resourcePath],
    					  @"/highfive.mp3"];
    	
    	//declare a system sound id
    	SystemSoundID ;soundID;      < 'soundID' undeclared
    	
    	//Get a URL for the sound file
    	NSURL *filePath = [NSURL fileURLWithPath:path isDirectory:NO];
    	
    	//Use audio sevices to create the sound
    	AudioServicesCreateSystemSoundID((CFURLRef)filePath, &soundID);
    	
    	//Use audio services to play the sound
    	AudioServicesPlaySystemSound(soundID);
    }
    What am I doing wrong and how do I get this to work :(
     
  2. codenamecueball thread starter macrumors regular

    Joined:
    Jul 28, 2009
    #2
    Ok, never mind, misplaced colon. Now I need to make it so when the image is tapped the sound plays. Would a button with the alpha set to 0 work? :apple:
     

Share This Page