├── README ├── jad0001a.wav ├── jad0002a.wav ├── jad0003a.wav ├── PlaySoundDemo1 ├── en.lproj │ ├── InfoPlist.strings │ └── ViewController.xib ├── PlaySoundDemo1-Prefix.pch ├── main.m ├── AppDelegate.h ├── ViewController.h ├── PlaySoundDemo1-Info.plist ├── AppDelegate.m └── ViewController.m ├── .gitignore └── PlaySoundDemo1.xcodeproj ├── project.xcworkspace └── contents.xcworkspacedata └── project.pbxproj /README: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /jad0001a.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samplecode/PlaySoundDemo1/master/jad0001a.wav -------------------------------------------------------------------------------- /jad0002a.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samplecode/PlaySoundDemo1/master/jad0002a.wav -------------------------------------------------------------------------------- /jad0003a.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samplecode/PlaySoundDemo1/master/jad0003a.wav -------------------------------------------------------------------------------- /PlaySoundDemo1/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | _Store 2 | *.swp 3 | *~.nib 4 | build/ 5 | *.pbxuser 6 | *.perspective 7 | *.perspectivev3 8 | xcuserdata 9 | -------------------------------------------------------------------------------- /PlaySoundDemo1.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /PlaySoundDemo1/PlaySoundDemo1-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'PlaySoundDemo1' target in the 'PlaySoundDemo1' project 3 | // 4 | 5 | #import 6 | 7 | #ifndef __IPHONE_4_0 8 | #warning "This project uses features only available in iOS SDK 4.0 and later." 9 | #endif 10 | 11 | #ifdef __OBJC__ 12 | #import 13 | #import 14 | #endif 15 | -------------------------------------------------------------------------------- /PlaySoundDemo1/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // PlaySoundDemo1 4 | // 5 | // Created by on 2011/10/28. 6 | // Copyright (c) 2011年 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "AppDelegate.h" 12 | 13 | int main(int argc, char *argv[]) 14 | { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /PlaySoundDemo1/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // PlaySoundDemo1 4 | // 5 | // Created by on 2011/10/28. 6 | // Copyright (c) 2011年 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class ViewController; 12 | 13 | @interface AppDelegate : UIResponder 14 | 15 | @property (strong, nonatomic) UIWindow *window; 16 | 17 | @property (strong, nonatomic) ViewController *viewController; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /PlaySoundDemo1/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // PlaySoundDemo1 4 | // 5 | // Created by on 2011/10/28. 6 | // Copyright (c) 2011年 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | #include 11 | 12 | @interface ViewController : UIViewController{ 13 | IBOutlet UISwitch *swcallback; 14 | IBOutlet UIPickerView *soundPicker; 15 | NSArray *soundData; 16 | SystemSoundID soundFileObject; 17 | } 18 | 19 | @property (nonatomic,retain) UISwitch *swcallback; 20 | @property (nonatomic,retain) UIPickerView *soundPicker; 21 | @property (nonatomic,retain) NSArray *soundData; 22 | @property (readonly) SystemSoundID soundFileObject; 23 | 24 | static void completionCallback (SystemSoundID mySSID, void* myself) ; 25 | - (IBAction) playSystemSound; 26 | - (IBAction) playAlertSound; 27 | - (IBAction) vibrate; 28 | -(IBAction) stopplaysound; 29 | -(void) GetPlaysound; 30 | 31 | @end -------------------------------------------------------------------------------- /PlaySoundDemo1/PlaySoundDemo1-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIconFiles 12 | 13 | CFBundleIdentifier 14 | tw.idv.wenshyansu.${PRODUCT_NAME:rfc1034identifier} 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleName 18 | ${PRODUCT_NAME} 19 | CFBundlePackageType 20 | APPL 21 | CFBundleShortVersionString 22 | 1.0 23 | CFBundleSignature 24 | ???? 25 | CFBundleVersion 26 | 1.0 27 | LSRequiresIPhoneOS 28 | 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /PlaySoundDemo1/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // PlaySoundDemo1 4 | // 5 | // Created by on 2011/10/28. 6 | // Copyright (c) 2011年 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | #import "ViewController.h" 12 | 13 | @implementation AppDelegate 14 | 15 | @synthesize window = _window; 16 | @synthesize viewController = _viewController; 17 | 18 | - (void)dealloc 19 | { 20 | [_window release]; 21 | [_viewController release]; 22 | [super dealloc]; 23 | } 24 | 25 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 26 | { 27 | self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease]; 28 | // Override point for customization after application launch. 29 | self.viewController = [[[ViewController alloc] initWithNibName:@"ViewController" bundle:nil] autorelease]; 30 | self.window.rootViewController = self.viewController; 31 | [self.window makeKeyAndVisible]; 32 | return YES; 33 | } 34 | 35 | - (void)applicationWillResignActive:(UIApplication *)application 36 | { 37 | /* 38 | Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 39 | Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 40 | */ 41 | } 42 | 43 | - (void)applicationDidEnterBackground:(UIApplication *)application 44 | { 45 | /* 46 | Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 47 | If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 48 | */ 49 | } 50 | 51 | - (void)applicationWillEnterForeground:(UIApplication *)application 52 | { 53 | /* 54 | Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 55 | */ 56 | } 57 | 58 | - (void)applicationDidBecomeActive:(UIApplication *)application 59 | { 60 | /* 61 | Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 62 | */ 63 | } 64 | 65 | - (void)applicationWillTerminate:(UIApplication *)application 66 | { 67 | /* 68 | Called when the application is about to terminate. 69 | Save data if appropriate. 70 | See also applicationDidEnterBackground:. 71 | */ 72 | } 73 | 74 | @end 75 | -------------------------------------------------------------------------------- /PlaySoundDemo1/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // PlaySoundDemo1 4 | // 5 | // Created by on 2011/10/28. 6 | // Copyright (c) 2011年 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | 11 | @implementation ViewController 12 | @synthesize swcallback,soundPicker,soundData,soundFileObject; 13 | 14 | - (void)didReceiveMemoryWarning 15 | { 16 | [super didReceiveMemoryWarning]; 17 | // Release any cached data, images, etc that aren't in use. 18 | } 19 | 20 | #pragma mark - View lifecycle 21 | 22 | - (void)viewDidLoad { 23 | 24 | [super viewDidLoad]; 25 | // Do any additional setup after loading the view, typically from a nib. 26 | 27 | //建立音效清單陣列 28 | NSArray *array=[[NSArray alloc] initWithObjects:@"音效1",@"音效2",@"音效3",nil]; 29 | self.soundData=array; 30 | [array release]; 31 | } 32 | 33 | - (void)viewDidUnload 34 | { 35 | [super viewDidUnload]; 36 | // Release any retained subviews of the main view. 37 | // e.g. self.myOutlet = nil; 38 | } 39 | 40 | - (void)viewWillAppear:(BOOL)animated 41 | { 42 | [super viewWillAppear:animated]; 43 | } 44 | 45 | - (void)viewDidAppear:(BOOL)animated 46 | { 47 | [super viewDidAppear:animated]; 48 | } 49 | 50 | - (void)viewWillDisappear:(BOOL)animated 51 | { 52 | [super viewWillDisappear:animated]; 53 | } 54 | 55 | - (void)viewDidDisappear:(BOOL)animated 56 | { 57 | [super viewDidDisappear:animated]; 58 | } 59 | 60 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 61 | { 62 | // Return YES for supported orientations 63 | return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown); 64 | } 65 | //停止當前音效的播放 66 | -(IBAction) stopplaysound{ 67 | AudioServicesRemoveSystemSoundCompletion (self.soundFileObject); 68 | } 69 | 70 | //建立聲音物件 71 | -(void) GetPlaysound{ 72 | [self stopplaysound]; 73 | 74 | //取出使用者所選擇的音效項目 75 | NSInteger row=[ soundPicker selectedRowInComponent:0]; 76 | 77 | //指定不同的音效檔 78 | NSString *soundfilename; 79 | switch (row) { 80 | case 0: 81 | soundfilename=@"jad0001a.wav"; 82 | break; 83 | case 1: 84 | soundfilename=@"jad0002a.wav"; 85 | break; 86 | case 2: 87 | soundfilename=@"jad0003a.wav"; 88 | break; 89 | default: 90 | break; 91 | } 92 | 93 | 94 | NSString *Path=[[NSBundle mainBundle] bundlePath]; 95 | NSURL *soundfileURL=[NSURL fileURLWithPath:[Path stringByAppendingPathComponent:soundfilename]]; 96 | 97 | //建立音效物件 98 | AudioServicesCreateSystemSoundID((CFURLRef)soundfileURL, &soundFileObject); 99 | 100 | //判斷是否連續播放 101 | if ([swcallback isOn]){ 102 | // Add sound completion callback 103 | AudioServicesAddSystemSoundCompletion (soundFileObject, NULL, NULL,completionCallback,(void*) self); 104 | } 105 | } 106 | 107 | //當音效播放完畢後的處理方式,這裡設定為再一次播放 108 | static void completionCallback (SystemSoundID mySSID, void* myself) { 109 | AudioServicesPlaySystemSound(mySSID); 110 | } 111 | 112 | - (IBAction) playSystemSound{ 113 | [self GetPlaysound]; 114 | AudioServicesPlaySystemSound (self.soundFileObject); 115 | // AudioServicesDisposeSystemSoundID (self.soundFileObject); 116 | } 117 | 118 | -(IBAction) playAlertSound{ 119 | [self GetPlaysound]; 120 | //播放音效 121 | AudioServicesPlayAlertSound (self.soundFileObject); 122 | } 123 | - (IBAction) vibrate{ 124 | //震動 125 | AudioServicesPlaySystemSound (kSystemSoundID_Vibrate); 126 | } 127 | 128 | - (void)dealloc { 129 | [super dealloc]; 130 | AudioServicesDisposeSystemSoundID (self.soundFileObject); 131 | } 132 | #pragma mark - 133 | #pragma mark soundPicker Data Soure 134 | - (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView{ 135 | return 1; 136 | } 137 | - (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component{ 138 | return [soundData count]; 139 | } 140 | #pragma mark - 141 | #pragma mark soundPicker Delegate 142 | - (NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component{ 143 | return [soundData objectAtIndex:row]; 144 | } 145 | @end 146 | -------------------------------------------------------------------------------- /PlaySoundDemo1.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | DD42D18B145A5E4200C34083 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DD42D18A145A5E4200C34083 /* UIKit.framework */; }; 11 | DD42D18D145A5E4200C34083 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DD42D18C145A5E4200C34083 /* Foundation.framework */; }; 12 | DD42D18F145A5E4200C34083 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DD42D18E145A5E4200C34083 /* CoreGraphics.framework */; }; 13 | DD42D195145A5E4200C34083 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = DD42D193145A5E4200C34083 /* InfoPlist.strings */; }; 14 | DD42D197145A5E4200C34083 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = DD42D196145A5E4200C34083 /* main.m */; }; 15 | DD42D19B145A5E4200C34083 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = DD42D19A145A5E4200C34083 /* AppDelegate.m */; }; 16 | DD42D19E145A5E4200C34083 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = DD42D19D145A5E4200C34083 /* ViewController.m */; }; 17 | DD42D1A1145A5E4200C34083 /* ViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = DD42D19F145A5E4200C34083 /* ViewController.xib */; }; 18 | DD42D1AA145A5F8300C34083 /* jad0001a.wav in Resources */ = {isa = PBXBuildFile; fileRef = DD42D1A7145A5F8300C34083 /* jad0001a.wav */; }; 19 | DD42D1AB145A5F8300C34083 /* jad0002a.wav in Resources */ = {isa = PBXBuildFile; fileRef = DD42D1A8145A5F8300C34083 /* jad0002a.wav */; }; 20 | DD42D1AC145A5F8300C34083 /* jad0003a.wav in Resources */ = {isa = PBXBuildFile; fileRef = DD42D1A9145A5F8300C34083 /* jad0003a.wav */; }; 21 | DD42D1AE145A5FD300C34083 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DD42D1AD145A5FD300C34083 /* AudioToolbox.framework */; }; 22 | /* End PBXBuildFile section */ 23 | 24 | /* Begin PBXFileReference section */ 25 | DD42D186145A5E4200C34083 /* PlaySoundDemo1.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = PlaySoundDemo1.app; sourceTree = BUILT_PRODUCTS_DIR; }; 26 | DD42D18A145A5E4200C34083 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 27 | DD42D18C145A5E4200C34083 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 28 | DD42D18E145A5E4200C34083 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 29 | DD42D192145A5E4200C34083 /* PlaySoundDemo1-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "PlaySoundDemo1-Info.plist"; sourceTree = ""; }; 30 | DD42D194145A5E4200C34083 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 31 | DD42D196145A5E4200C34083 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 32 | DD42D198145A5E4200C34083 /* PlaySoundDemo1-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "PlaySoundDemo1-Prefix.pch"; sourceTree = ""; }; 33 | DD42D199145A5E4200C34083 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 34 | DD42D19A145A5E4200C34083 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 35 | DD42D19C145A5E4200C34083 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 36 | DD42D19D145A5E4200C34083 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 37 | DD42D1A0145A5E4200C34083 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/ViewController.xib; sourceTree = ""; }; 38 | DD42D1A7145A5F8300C34083 /* jad0001a.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; path = jad0001a.wav; sourceTree = ""; }; 39 | DD42D1A8145A5F8300C34083 /* jad0002a.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; path = jad0002a.wav; sourceTree = ""; }; 40 | DD42D1A9145A5F8300C34083 /* jad0003a.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; path = jad0003a.wav; sourceTree = ""; }; 41 | DD42D1AD145A5FD300C34083 /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; }; 42 | /* End PBXFileReference section */ 43 | 44 | /* Begin PBXFrameworksBuildPhase section */ 45 | DD42D183145A5E4200C34083 /* Frameworks */ = { 46 | isa = PBXFrameworksBuildPhase; 47 | buildActionMask = 2147483647; 48 | files = ( 49 | DD42D1AE145A5FD300C34083 /* AudioToolbox.framework in Frameworks */, 50 | DD42D18B145A5E4200C34083 /* UIKit.framework in Frameworks */, 51 | DD42D18D145A5E4200C34083 /* Foundation.framework in Frameworks */, 52 | DD42D18F145A5E4200C34083 /* CoreGraphics.framework in Frameworks */, 53 | ); 54 | runOnlyForDeploymentPostprocessing = 0; 55 | }; 56 | /* End PBXFrameworksBuildPhase section */ 57 | 58 | /* Begin PBXGroup section */ 59 | DD42D17B145A5E4200C34083 = { 60 | isa = PBXGroup; 61 | children = ( 62 | DD42D1AD145A5FD300C34083 /* AudioToolbox.framework */, 63 | DD42D1A7145A5F8300C34083 /* jad0001a.wav */, 64 | DD42D1A8145A5F8300C34083 /* jad0002a.wav */, 65 | DD42D1A9145A5F8300C34083 /* jad0003a.wav */, 66 | DD42D190145A5E4200C34083 /* PlaySoundDemo1 */, 67 | DD42D189145A5E4200C34083 /* Frameworks */, 68 | DD42D187145A5E4200C34083 /* Products */, 69 | ); 70 | sourceTree = ""; 71 | }; 72 | DD42D187145A5E4200C34083 /* Products */ = { 73 | isa = PBXGroup; 74 | children = ( 75 | DD42D186145A5E4200C34083 /* PlaySoundDemo1.app */, 76 | ); 77 | name = Products; 78 | sourceTree = ""; 79 | }; 80 | DD42D189145A5E4200C34083 /* Frameworks */ = { 81 | isa = PBXGroup; 82 | children = ( 83 | DD42D18A145A5E4200C34083 /* UIKit.framework */, 84 | DD42D18C145A5E4200C34083 /* Foundation.framework */, 85 | DD42D18E145A5E4200C34083 /* CoreGraphics.framework */, 86 | ); 87 | name = Frameworks; 88 | sourceTree = ""; 89 | }; 90 | DD42D190145A5E4200C34083 /* PlaySoundDemo1 */ = { 91 | isa = PBXGroup; 92 | children = ( 93 | DD42D199145A5E4200C34083 /* AppDelegate.h */, 94 | DD42D19A145A5E4200C34083 /* AppDelegate.m */, 95 | DD42D19C145A5E4200C34083 /* ViewController.h */, 96 | DD42D19D145A5E4200C34083 /* ViewController.m */, 97 | DD42D19F145A5E4200C34083 /* ViewController.xib */, 98 | DD42D191145A5E4200C34083 /* Supporting Files */, 99 | ); 100 | path = PlaySoundDemo1; 101 | sourceTree = ""; 102 | }; 103 | DD42D191145A5E4200C34083 /* Supporting Files */ = { 104 | isa = PBXGroup; 105 | children = ( 106 | DD42D192145A5E4200C34083 /* PlaySoundDemo1-Info.plist */, 107 | DD42D193145A5E4200C34083 /* InfoPlist.strings */, 108 | DD42D196145A5E4200C34083 /* main.m */, 109 | DD42D198145A5E4200C34083 /* PlaySoundDemo1-Prefix.pch */, 110 | ); 111 | name = "Supporting Files"; 112 | sourceTree = ""; 113 | }; 114 | /* End PBXGroup section */ 115 | 116 | /* Begin PBXNativeTarget section */ 117 | DD42D185145A5E4200C34083 /* PlaySoundDemo1 */ = { 118 | isa = PBXNativeTarget; 119 | buildConfigurationList = DD42D1A4145A5E4200C34083 /* Build configuration list for PBXNativeTarget "PlaySoundDemo1" */; 120 | buildPhases = ( 121 | DD42D182145A5E4200C34083 /* Sources */, 122 | DD42D183145A5E4200C34083 /* Frameworks */, 123 | DD42D184145A5E4200C34083 /* Resources */, 124 | ); 125 | buildRules = ( 126 | ); 127 | dependencies = ( 128 | ); 129 | name = PlaySoundDemo1; 130 | productName = PlaySoundDemo1; 131 | productReference = DD42D186145A5E4200C34083 /* PlaySoundDemo1.app */; 132 | productType = "com.apple.product-type.application"; 133 | }; 134 | /* End PBXNativeTarget section */ 135 | 136 | /* Begin PBXProject section */ 137 | DD42D17D145A5E4200C34083 /* Project object */ = { 138 | isa = PBXProject; 139 | attributes = { 140 | LastUpgradeCheck = 0420; 141 | }; 142 | buildConfigurationList = DD42D180145A5E4200C34083 /* Build configuration list for PBXProject "PlaySoundDemo1" */; 143 | compatibilityVersion = "Xcode 3.2"; 144 | developmentRegion = English; 145 | hasScannedForEncodings = 0; 146 | knownRegions = ( 147 | en, 148 | ); 149 | mainGroup = DD42D17B145A5E4200C34083; 150 | productRefGroup = DD42D187145A5E4200C34083 /* Products */; 151 | projectDirPath = ""; 152 | projectRoot = ""; 153 | targets = ( 154 | DD42D185145A5E4200C34083 /* PlaySoundDemo1 */, 155 | ); 156 | }; 157 | /* End PBXProject section */ 158 | 159 | /* Begin PBXResourcesBuildPhase section */ 160 | DD42D184145A5E4200C34083 /* Resources */ = { 161 | isa = PBXResourcesBuildPhase; 162 | buildActionMask = 2147483647; 163 | files = ( 164 | DD42D195145A5E4200C34083 /* InfoPlist.strings in Resources */, 165 | DD42D1A1145A5E4200C34083 /* ViewController.xib in Resources */, 166 | DD42D1AA145A5F8300C34083 /* jad0001a.wav in Resources */, 167 | DD42D1AB145A5F8300C34083 /* jad0002a.wav in Resources */, 168 | DD42D1AC145A5F8300C34083 /* jad0003a.wav in Resources */, 169 | ); 170 | runOnlyForDeploymentPostprocessing = 0; 171 | }; 172 | /* End PBXResourcesBuildPhase section */ 173 | 174 | /* Begin PBXSourcesBuildPhase section */ 175 | DD42D182145A5E4200C34083 /* Sources */ = { 176 | isa = PBXSourcesBuildPhase; 177 | buildActionMask = 2147483647; 178 | files = ( 179 | DD42D197145A5E4200C34083 /* main.m in Sources */, 180 | DD42D19B145A5E4200C34083 /* AppDelegate.m in Sources */, 181 | DD42D19E145A5E4200C34083 /* ViewController.m in Sources */, 182 | ); 183 | runOnlyForDeploymentPostprocessing = 0; 184 | }; 185 | /* End PBXSourcesBuildPhase section */ 186 | 187 | /* Begin PBXVariantGroup section */ 188 | DD42D193145A5E4200C34083 /* InfoPlist.strings */ = { 189 | isa = PBXVariantGroup; 190 | children = ( 191 | DD42D194145A5E4200C34083 /* en */, 192 | ); 193 | name = InfoPlist.strings; 194 | sourceTree = ""; 195 | }; 196 | DD42D19F145A5E4200C34083 /* ViewController.xib */ = { 197 | isa = PBXVariantGroup; 198 | children = ( 199 | DD42D1A0145A5E4200C34083 /* en */, 200 | ); 201 | name = ViewController.xib; 202 | sourceTree = ""; 203 | }; 204 | /* End PBXVariantGroup section */ 205 | 206 | /* Begin XCBuildConfiguration section */ 207 | DD42D1A2145A5E4200C34083 /* Debug */ = { 208 | isa = XCBuildConfiguration; 209 | buildSettings = { 210 | ALWAYS_SEARCH_USER_PATHS = NO; 211 | ARCHS = "$(ARCHS_STANDARD_32_BIT)"; 212 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 213 | COPY_PHASE_STRIP = NO; 214 | GCC_C_LANGUAGE_STANDARD = gnu99; 215 | GCC_DYNAMIC_NO_PIC = NO; 216 | GCC_OPTIMIZATION_LEVEL = 0; 217 | GCC_PREPROCESSOR_DEFINITIONS = ( 218 | "DEBUG=1", 219 | "$(inherited)", 220 | ); 221 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 222 | GCC_VERSION = com.apple.compilers.llvm.clang.1_0; 223 | GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; 224 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 225 | GCC_WARN_UNUSED_VARIABLE = YES; 226 | IPHONEOS_DEPLOYMENT_TARGET = 5.0; 227 | SDKROOT = iphoneos; 228 | }; 229 | name = Debug; 230 | }; 231 | DD42D1A3145A5E4200C34083 /* Release */ = { 232 | isa = XCBuildConfiguration; 233 | buildSettings = { 234 | ALWAYS_SEARCH_USER_PATHS = NO; 235 | ARCHS = "$(ARCHS_STANDARD_32_BIT)"; 236 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 237 | COPY_PHASE_STRIP = YES; 238 | GCC_C_LANGUAGE_STANDARD = gnu99; 239 | GCC_VERSION = com.apple.compilers.llvm.clang.1_0; 240 | GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; 241 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 242 | GCC_WARN_UNUSED_VARIABLE = YES; 243 | IPHONEOS_DEPLOYMENT_TARGET = 5.0; 244 | OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; 245 | SDKROOT = iphoneos; 246 | VALIDATE_PRODUCT = YES; 247 | }; 248 | name = Release; 249 | }; 250 | DD42D1A5145A5E4200C34083 /* Debug */ = { 251 | isa = XCBuildConfiguration; 252 | buildSettings = { 253 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 254 | GCC_PREFIX_HEADER = "PlaySoundDemo1/PlaySoundDemo1-Prefix.pch"; 255 | INFOPLIST_FILE = "PlaySoundDemo1/PlaySoundDemo1-Info.plist"; 256 | PRODUCT_NAME = "$(TARGET_NAME)"; 257 | WRAPPER_EXTENSION = app; 258 | }; 259 | name = Debug; 260 | }; 261 | DD42D1A6145A5E4200C34083 /* Release */ = { 262 | isa = XCBuildConfiguration; 263 | buildSettings = { 264 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 265 | GCC_PREFIX_HEADER = "PlaySoundDemo1/PlaySoundDemo1-Prefix.pch"; 266 | INFOPLIST_FILE = "PlaySoundDemo1/PlaySoundDemo1-Info.plist"; 267 | PRODUCT_NAME = "$(TARGET_NAME)"; 268 | WRAPPER_EXTENSION = app; 269 | }; 270 | name = Release; 271 | }; 272 | /* End XCBuildConfiguration section */ 273 | 274 | /* Begin XCConfigurationList section */ 275 | DD42D180145A5E4200C34083 /* Build configuration list for PBXProject "PlaySoundDemo1" */ = { 276 | isa = XCConfigurationList; 277 | buildConfigurations = ( 278 | DD42D1A2145A5E4200C34083 /* Debug */, 279 | DD42D1A3145A5E4200C34083 /* Release */, 280 | ); 281 | defaultConfigurationIsVisible = 0; 282 | defaultConfigurationName = Release; 283 | }; 284 | DD42D1A4145A5E4200C34083 /* Build configuration list for PBXNativeTarget "PlaySoundDemo1" */ = { 285 | isa = XCConfigurationList; 286 | buildConfigurations = ( 287 | DD42D1A5145A5E4200C34083 /* Debug */, 288 | DD42D1A6145A5E4200C34083 /* Release */, 289 | ); 290 | defaultConfigurationIsVisible = 0; 291 | }; 292 | /* End XCConfigurationList section */ 293 | }; 294 | rootObject = DD42D17D145A5E4200C34083 /* Project object */; 295 | } 296 | -------------------------------------------------------------------------------- /PlaySoundDemo1/en.lproj/ViewController.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1280 5 | 10K549 6 | 1938 7 | 1038.36 8 | 461.00 9 | 10 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 11 | 933 12 | 13 | 14 | IBUIPickerView 15 | IBUIButton 16 | IBUISwitch 17 | IBUIView 18 | IBUILabel 19 | IBProxyObject 20 | 21 | 22 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 23 | 24 | 25 | PluginDependencyRecalculationVersion 26 | 27 | 28 | 29 | 30 | IBFilesOwner 31 | IBCocoaTouchFramework 32 | 33 | 34 | IBFirstResponder 35 | IBCocoaTouchFramework 36 | 37 | 38 | 39 | 274 40 | 41 | 42 | 43 | 292 44 | {{20, 381}, {280, 37}} 45 | 46 | 47 | 48 | NO 49 | IBCocoaTouchFramework 50 | 0 51 | 0 52 | 1 53 | 停止 54 | 55 | 3 56 | MQA 57 | 58 | 59 | 1 60 | MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA 61 | 62 | 63 | 3 64 | MC41AA 65 | 66 | 67 | 2 68 | 15 69 | 70 | 71 | Helvetica-Bold 72 | 15 73 | 16 74 | 75 | 76 | 77 | 78 | 292 79 | {{20, 336}, {72, 37}} 80 | 81 | 82 | 83 | NO 84 | IBCocoaTouchFramework 85 | 0 86 | 0 87 | 1 88 | 播放 89 | 90 | 91 | 1 92 | MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 292 101 | {{228, 336}, {72, 37}} 102 | 103 | 104 | 105 | NO 106 | IBCocoaTouchFramework 107 | 0 108 | 0 109 | 1 110 | 震動 111 | 112 | 113 | 1 114 | MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 292 123 | {{109, 336}, {102, 37}} 124 | 125 | 126 | 127 | NO 128 | IBCocoaTouchFramework 129 | 0 130 | 0 131 | 1 132 | 播放 + 震動 133 | 134 | 135 | 1 136 | MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 290 145 | {{0, 59}, {320, 216}} 146 | 147 | 148 | 149 | IBCocoaTouchFramework 150 | YES 151 | 152 | 153 | 154 | 292 155 | {{109, 20}, {102, 21}} 156 | 157 | 158 | 159 | NO 160 | YES 161 | 7 162 | NO 163 | IBCocoaTouchFramework 164 | 音效播放示範 165 | 166 | 1 167 | MCAwIDAAA 168 | 169 | 170 | 1 171 | 10 172 | 173 | 1 174 | 17 175 | 176 | 177 | Helvetica 178 | 17 179 | 16 180 | 181 | 182 | 183 | 184 | 292 185 | {{109, 294}, {102, 21}} 186 | 187 | 188 | 189 | NO 190 | YES 191 | 7 192 | NO 193 | IBCocoaTouchFramework 194 | 啓用循環播放 195 | 196 | 197 | 1 198 | 10 199 | 200 | 201 | 202 | 203 | 204 | 292 205 | {{206, 294}, {94, 27}} 206 | 207 | 208 | NO 209 | IBCocoaTouchFramework 210 | 0 211 | 0 212 | YES 213 | 214 | 215 | {{0, 20}, {320, 460}} 216 | 217 | 218 | 219 | 220 | 3 221 | MC43NQA 222 | 223 | 2 224 | 225 | 226 | NO 227 | 228 | IBCocoaTouchFramework 229 | 230 | 231 | 232 | 233 | 234 | 235 | view 236 | 237 | 238 | 239 | 7 240 | 241 | 242 | 243 | soundPicker 244 | 245 | 246 | 247 | 16 248 | 249 | 250 | 251 | swcallback 252 | 253 | 254 | 255 | 19 256 | 257 | 258 | 259 | stopplaysound 260 | 261 | 262 | 7 263 | 264 | 17 265 | 266 | 267 | 268 | playAlertSound 269 | 270 | 271 | 7 272 | 273 | 20 274 | 275 | 276 | 277 | vibrate 278 | 279 | 280 | 7 281 | 282 | 18 283 | 284 | 285 | 286 | playSystemSound 287 | 288 | 289 | 7 290 | 291 | 21 292 | 293 | 294 | 295 | dataSource 296 | 297 | 298 | 299 | 22 300 | 301 | 302 | 303 | delegate 304 | 305 | 306 | 307 | 23 308 | 309 | 310 | 311 | 312 | 313 | 0 314 | 315 | 316 | 317 | 318 | 319 | -1 320 | 321 | 322 | File's Owner 323 | 324 | 325 | -2 326 | 327 | 328 | 329 | 330 | 6 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 340 | 341 | 342 | 343 | 344 | 345 | 8 346 | 347 | 348 | 349 | 350 | 9 351 | 352 | 353 | 354 | 355 | 10 356 | 357 | 358 | 359 | 360 | 11 361 | 362 | 363 | 364 | 365 | 12 366 | 367 | 368 | 369 | 370 | 13 371 | 372 | 373 | 374 | 375 | 14 376 | 377 | 378 | 379 | 380 | 15 381 | 382 | 383 | 384 | 385 | 386 | 387 | ViewController 388 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 389 | UIResponder 390 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 391 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 392 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 393 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 394 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 395 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 396 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 397 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 398 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 399 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 400 | 401 | 402 | 403 | 404 | 405 | 23 406 | 407 | 408 | 409 | 410 | ViewController 411 | UIViewController 412 | 413 | id 414 | id 415 | id 416 | id 417 | 418 | 419 | 420 | playAlertSound 421 | id 422 | 423 | 424 | playSystemSound 425 | id 426 | 427 | 428 | stopplaysound 429 | id 430 | 431 | 432 | vibrate 433 | id 434 | 435 | 436 | 437 | UIPickerView 438 | UISwitch 439 | 440 | 441 | 442 | soundPicker 443 | UIPickerView 444 | 445 | 446 | swcallback 447 | UISwitch 448 | 449 | 450 | 451 | IBProjectSource 452 | ./Classes/ViewController.h 453 | 454 | 455 | 456 | 457 | 0 458 | IBCocoaTouchFramework 459 | YES 460 | 3 461 | 933 462 | 463 | 464 | --------------------------------------------------------------------------------