Created
September 24, 2012 04:48
-
-
Save C4Code/3774225 to your computer and use it in GitHub Desktop.
Toggle Audio Playback
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// C4WorkSpace.m | |
// gettingThingsOnScreen | |
// | |
// Created by moi on 12-09-23. | |
// Copyright (c) 2012 moi. All rights reserved. | |
// | |
#import "C4WorkSpace.h" | |
@implementation C4WorkSpace { | |
C4Sample *audioSample; | |
} | |
-(void)setup { | |
audioSample = [C4Sample sampleNamed:@"C4Loop.aif"]; | |
} | |
-(void)touchesBegan { | |
if(audioSample.isPlaying) { | |
[audioSample stop]; | |
} else { | |
[audioSample play]; | |
} | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment