├── .gitignore
├── testAudioListen
├── KKAudioControl
│ ├── KKMuteSwitchListener.bundle
│ │ └── silence.mp3
│ ├── KKAudioLongPressListener.h
│ ├── KKAudioControlManager.h
│ ├── KKMuteSwitchListener.h
│ ├── KKVolumeProgressWindow.h
│ ├── KKAudioControlManager.m
│ ├── KKMuteSwitchListener.m
│ ├── KKAudioLongPressListener.m
│ └── KKVolumeProgressWindow.m
├── ViewController.h
├── AppDelegate.h
├── main.m
├── Assets.xcassets
│ └── AppIcon.appiconset
│ │ └── Contents.json
├── Info.plist
├── Base.lproj
│ ├── LaunchScreen.storyboard
│ └── Main.storyboard
├── AppDelegate.m
└── ViewController.m
├── testAudioListen.xcodeproj
├── project.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcuserdata
│ │ └── kevin.xcuserdatad
│ │ └── UserInterfaceState.xcuserstate
├── xcuserdata
│ └── kevin.xcuserdatad
│ │ └── xcschemes
│ │ ├── xcschememanagement.plist
│ │ └── testAudioListen.xcscheme
└── project.pbxproj
└── README.md
/.gitignore:
--------------------------------------------------------------------------------
1 |
2 | *.xcuserstate
3 |
--------------------------------------------------------------------------------
/testAudioListen/KKAudioControl/KKMuteSwitchListener.bundle/silence.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kevinMkY/KKAudioListenManager/HEAD/testAudioListen/KKAudioControl/KKMuteSwitchListener.bundle/silence.mp3
--------------------------------------------------------------------------------
/testAudioListen.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/testAudioListen.xcodeproj/project.xcworkspace/xcuserdata/kevin.xcuserdatad/UserInterfaceState.xcuserstate:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kevinMkY/KKAudioListenManager/HEAD/testAudioListen.xcodeproj/project.xcworkspace/xcuserdata/kevin.xcuserdatad/UserInterfaceState.xcuserstate
--------------------------------------------------------------------------------
/testAudioListen/ViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.h
3 | // testAudioListen
4 | //
5 | // Created by nice on 16/7/19.
6 | // Copyright © 2016年 kk. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface ViewController : UIViewController
12 |
13 |
14 | @end
15 |
16 |
--------------------------------------------------------------------------------
/testAudioListen/AppDelegate.h:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.h
3 | // testAudioListen
4 | //
5 | // Created by nice on 16/7/19.
6 | // Copyright © 2016年 kk. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface AppDelegate : UIResponder
12 |
13 | @property (strong, nonatomic) UIWindow *window;
14 |
15 |
16 | @end
17 |
18 |
--------------------------------------------------------------------------------
/testAudioListen/KKAudioControl/KKAudioLongPressListener.h:
--------------------------------------------------------------------------------
1 | //
2 | // KKAudioLongPressListener.h
3 | // KKShopping
4 | //
5 | // Created by nice on 16/8/24.
6 | // Copyright © 2016年 nice. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface KKAudioLongPressListener : UIView
12 |
13 | + (void)beginListen;
14 | + (void)stopListen;
15 |
16 | @end
17 |
--------------------------------------------------------------------------------
/testAudioListen/main.m:
--------------------------------------------------------------------------------
1 | //
2 | // main.m
3 | // testAudioListen
4 | //
5 | // Created by nice on 16/7/19.
6 | // Copyright © 2016年 kk. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "AppDelegate.h"
11 |
12 | int main(int argc, char * argv[]) {
13 | @autoreleasepool {
14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/testAudioListen/KKAudioControl/KKAudioControlManager.h:
--------------------------------------------------------------------------------
1 | //
2 | // KKAudioControlManager.h
3 | //
4 | // Created by nice on 16/7/19.
5 | // Copyright © 2016年 kk. All rights reserved.
6 | //
7 |
8 | #import
9 | #import
10 | #import "KKVolumeProgressWindow.h"
11 |
12 |
13 | @interface KKAudioControlManager : NSObject
14 |
15 | + (instancetype)shareInstance;
16 |
17 | - (KKVolumeProgressWindow *)volumeView;
18 |
19 | - (void)addVolumeListener;
20 | - (void)removeVolumeListener;
21 |
22 | - (void)addMuteListener;
23 | - (void)removeMuteListener;
24 |
25 | @end
26 |
--------------------------------------------------------------------------------
/testAudioListen/KKAudioControl/KKMuteSwitchListener.h:
--------------------------------------------------------------------------------
1 | //
2 | // KKMuteSwitchListener.h
3 | //
4 | // Created by nice on 16/7/19.
5 | // Copyright © 2016年 kk. All rights reserved.
6 | //
7 |
8 | #import
9 | #import
10 |
11 | typedef void(^KKMuteSwitchListenerBlock)(BOOL silent);
12 |
13 | @interface KKMuteSwitchListener : NSObject
14 |
15 | @property (nonatomic,readonly) BOOL isMute;
16 | @property (nonatomic,copy) KKMuteSwitchListenerBlock muteListenerBlock;
17 |
18 | @property (nonatomic, assign) BOOL shouldBreak;
19 |
20 | + (instancetype)shareInstance;
21 |
22 | @end
23 |
--------------------------------------------------------------------------------
/testAudioListen.xcodeproj/xcuserdata/kevin.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | testAudioListen.xcscheme
8 |
9 | orderHint
10 | 0
11 |
12 |
13 | SuppressBuildableAutocreation
14 |
15 | 0681FC421D3E3C8300AEFD20
16 |
17 | primary
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/testAudioListen/KKAudioControl/KKVolumeProgressWindow.h:
--------------------------------------------------------------------------------
1 | //
2 | // KKVolumeView.h
3 | //
4 | // Created by nice on 16/7/19.
5 | // Copyright © 2016年 kk. All rights reserved.
6 | //
7 |
8 | #import
9 |
10 | @class KKVolumeProgressWindow;
11 |
12 | typedef NS_ENUM(NSInteger,KKVolumeViewAnimation){
13 | KKVolumeViewAnimationNone = 0,
14 | KKVolumeViewAnimationFade,
15 | KKVolumeViewAnimationSlideDown
16 | };
17 |
18 | @protocol KKVolumeViewDelegate
19 |
20 | - (void)volumeView:(KKVolumeProgressWindow *)volumeView willChangeValue:(CGFloat)value oldValue:(CGFloat)oldValue;
21 | - (void)volumeView:(KKVolumeProgressWindow *)volumeView didChangeValue:(CGFloat)value oldValue:(CGFloat)oldValue;
22 |
23 | @optional
24 | - (void)volumeViewDidMuteOn:(KKVolumeProgressWindow *)volumeView;
25 | - (void)volumeViewDidMuteOff:(KKVolumeProgressWindow *)volumeView;
26 |
27 | @end
28 |
29 | @interface KKVolumeProgressWindow : UIWindow
30 |
31 | @property (nonatomic, assign) KKVolumeViewAnimation animationType;
32 | @property (nonatomic, strong) UIColor *progressBarBackgroundColor;
33 | @property (nonatomic, strong) UIColor *progressBarTintColor;
34 | @property (nonatomic, strong) UIColor *volumeStatusBackgroundColor;
35 | @property (nonatomic, weak) id delegate;
36 |
37 | + (instancetype)defaultVolumeView;
38 | - (void)removeAllAudioListen;
39 |
40 | @end
41 |
--------------------------------------------------------------------------------
/testAudioListen/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "size" : "29x29",
6 | "scale" : "2x"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "size" : "29x29",
11 | "scale" : "3x"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "size" : "40x40",
16 | "scale" : "2x"
17 | },
18 | {
19 | "idiom" : "iphone",
20 | "size" : "40x40",
21 | "scale" : "3x"
22 | },
23 | {
24 | "idiom" : "iphone",
25 | "size" : "60x60",
26 | "scale" : "2x"
27 | },
28 | {
29 | "idiom" : "iphone",
30 | "size" : "60x60",
31 | "scale" : "3x"
32 | },
33 | {
34 | "idiom" : "ipad",
35 | "size" : "29x29",
36 | "scale" : "1x"
37 | },
38 | {
39 | "idiom" : "ipad",
40 | "size" : "29x29",
41 | "scale" : "2x"
42 | },
43 | {
44 | "idiom" : "ipad",
45 | "size" : "40x40",
46 | "scale" : "1x"
47 | },
48 | {
49 | "idiom" : "ipad",
50 | "size" : "40x40",
51 | "scale" : "2x"
52 | },
53 | {
54 | "idiom" : "ipad",
55 | "size" : "76x76",
56 | "scale" : "1x"
57 | },
58 | {
59 | "idiom" : "ipad",
60 | "size" : "76x76",
61 | "scale" : "2x"
62 | }
63 | ],
64 | "info" : {
65 | "version" : 1,
66 | "author" : "xcode"
67 | }
68 | }
--------------------------------------------------------------------------------
/testAudioListen/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 | LSRequiresIPhoneOS
24 |
25 | UILaunchStoryboardName
26 | LaunchScreen
27 | UIMainStoryboardFile
28 | Main
29 | UIRequiredDeviceCapabilities
30 |
31 | armv7
32 |
33 | UISupportedInterfaceOrientations
34 |
35 | UIInterfaceOrientationPortrait
36 | UIInterfaceOrientationLandscapeLeft
37 | UIInterfaceOrientationLandscapeRight
38 |
39 | UISupportedInterfaceOrientations~ipad
40 |
41 | UIInterfaceOrientationPortrait
42 | UIInterfaceOrientationPortraitUpsideDown
43 | UIInterfaceOrientationLandscapeLeft
44 | UIInterfaceOrientationLandscapeRight
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/testAudioListen/Base.lproj/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/testAudioListen/AppDelegate.m:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.m
3 | // testAudioListen
4 | //
5 | // Created by nice on 16/7/19.
6 | // Copyright © 2016年 kk. All rights reserved.
7 | //
8 |
9 | #import "AppDelegate.h"
10 |
11 | @interface AppDelegate ()
12 |
13 | @end
14 |
15 | @implementation AppDelegate
16 |
17 |
18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
19 | // Override point for customization after application launch.
20 | return YES;
21 | }
22 |
23 | - (void)applicationWillResignActive:(UIApplication *)application {
24 | // 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.
25 | // 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.
26 | }
27 |
28 | - (void)applicationDidEnterBackground:(UIApplication *)application {
29 | // 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.
30 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
31 | }
32 |
33 | - (void)applicationWillEnterForeground:(UIApplication *)application {
34 | // 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.
35 | }
36 |
37 | - (void)applicationDidBecomeActive:(UIApplication *)application {
38 | // 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.
39 | }
40 |
41 | - (void)applicationWillTerminate:(UIApplication *)application {
42 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
43 | }
44 |
45 | @end
46 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # KKAudioListenManager
2 | iOS - 监听音量按键及监听静音按键,自定义音量条
3 |
4 | > 1.自定义音量条,覆盖在电池栏上方
5 |
6 | > 2.监听音量按键的增大/减小,即使当前处于100%音量,按+依然可以调用
7 |
8 | > 3.监听静音按键的开/关
9 |
10 | # 预览图
11 |
12 | 注意看点1.状态栏自定义音量条
13 |
14 | 注意看点2.切换物理静音开关,button文案自动切换
15 |
16 | 
17 |
18 | 看不到图点这个 > http://7xn5aw.com1.z0.glb.clouddn.com/AudioListenerlisten.gif
19 |
20 | # 使用方法
21 | ## 1.导入头文件
22 | ```
23 | #import "KKAudioControlManager.h"
24 | ```
25 |
26 | ## 2.开启音量/静音监控
27 |
28 | ```
29 | [[KKAudioControlManager shareInstance] addVolumeListener];
30 | [[KKAudioControlManager shareInstance] addMuteListener];
31 | ```
32 |
33 | ## 3.注册通知监听
34 |
35 |
36 | ```
37 | - (void)regNotifi
38 | {
39 | [[NSNotificationCenter defaultCenter] addObserver:self
40 | selector:@selector(audioControlVolumeBigger)
41 | name:KKAudioControlVolumeBiggerNotification
42 | object:nil];
43 |
44 | [[NSNotificationCenter defaultCenter] addObserver:self
45 | selector:@selector(audioControlVolumeSmaller)
46 | name:KKAudioControlVolumeSmallerNotification
47 | object:nil];
48 |
49 | [[NSNotificationCenter defaultCenter] addObserver:self
50 | selector:@selector(audioControlMuteTurnOn)
51 | name:KKAudioControlMuteTurnOnNotification
52 | object:nil];
53 |
54 | [[NSNotificationCenter defaultCenter] addObserver:self
55 | selector:@selector(audioControlMuteTurnOff)
56 | name:KKAudioControlMuteTurnOffNotification
57 | object:nil];
58 | }
59 |
60 | #pragma mark - audio
61 |
62 | - (void)audioControlVolumeBigger
63 | {
64 | NSLog(@"volume ++ ");
65 | }
66 |
67 | - (void)audioControlVolumeSmaller
68 | {
69 | NSLog(@"volume -- ");
70 | }
71 |
72 | - (void)audioControlMuteTurnOn
73 | {
74 | NSLog(@"mute on ");
75 | }
76 | - (void)audioControlMuteTurnOff
77 | {
78 | NSLog(@"mute off ");
79 | }
80 |
81 | ```
82 |
83 | ## 4.移除监听
84 |
85 | ```
86 | [[KKAudioControlManager shareInstance] removeMuteListener];
87 | [[KKAudioControlManager shareInstance] removeVolumeListener];
88 | ```
89 |
--------------------------------------------------------------------------------
/testAudioListen/ViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.m
3 | //
4 | // Created by nice on 16/7/19.
5 | // Copyright © 2016年 kk. All rights reserved.
6 | //
7 |
8 | #import "ViewController.h"
9 | #import "KKAudioControlManager.h"
10 | #import "KKAudioLongPressListener.h"
11 |
12 | extern NSString * KKAudioControlVolumeBiggerNotification;
13 | extern NSString * KKAudioControlVolumeSmallerNotification;
14 | extern NSString * KKAudioControlMuteTurnOnNotification;
15 | extern NSString * KKAudioControlMuteTurnOffNotification;
16 |
17 | @interface ViewController ()
18 | @property (weak, nonatomic) IBOutlet UIButton *button;
19 | @end
20 |
21 | @implementation ViewController
22 |
23 | - (void)viewDidLoad {
24 | [super viewDidLoad];
25 |
26 | [self regNotifi];
27 |
28 | [[KKAudioControlManager shareInstance] addVolumeListener];
29 | [[KKAudioControlManager shareInstance] addMuteListener];
30 |
31 | [KKAudioLongPressListener beginListen];
32 | }
33 |
34 | - (IBAction)buttonClick:(id)sender {
35 |
36 | }
37 |
38 | #pragma mark - audio
39 |
40 | - (void)audioControlVolumeBigger
41 | {
42 | NSLog(@"volume ++ ");
43 | }
44 |
45 | - (void)audioControlVolumeSmaller
46 | {
47 | NSLog(@"volume -- ");
48 | }
49 |
50 | - (void)audioControlMuteTurnOn
51 | {
52 | [self.button setTitle:@"mute on" forState:UIControlStateNormal];
53 | }
54 | - (void)audioControlMuteTurnOff
55 | {
56 | [self.button setTitle:@"mute off" forState:UIControlStateNormal];
57 | }
58 |
59 | - (void)regNotifi
60 | {
61 | [[NSNotificationCenter defaultCenter] addObserver:self
62 | selector:@selector(audioControlVolumeBigger)
63 | name:KKAudioControlVolumeBiggerNotification
64 | object:nil];
65 |
66 | [[NSNotificationCenter defaultCenter] addObserver:self
67 | selector:@selector(audioControlVolumeSmaller)
68 | name:KKAudioControlVolumeSmallerNotification
69 | object:nil];
70 |
71 | [[NSNotificationCenter defaultCenter] addObserver:self
72 | selector:@selector(audioControlMuteTurnOn)
73 | name:KKAudioControlMuteTurnOnNotification
74 | object:nil];
75 |
76 | [[NSNotificationCenter defaultCenter] addObserver:self
77 | selector:@selector(audioControlMuteTurnOff)
78 | name:KKAudioControlMuteTurnOffNotification
79 | object:nil];
80 | }
81 |
82 | @end
83 |
--------------------------------------------------------------------------------
/testAudioListen/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/testAudioListen/KKAudioControl/KKAudioControlManager.m:
--------------------------------------------------------------------------------
1 | //
2 | // KKAudioControlManager.m
3 | //
4 | // Created by nice on 16/7/19.
5 | // Copyright © 2016年 kk. All rights reserved.
6 | //
7 |
8 | #import "KKAudioControlManager.h"
9 | #import "KKVolumeProgressWindow.h"
10 | #import "KKMuteSwitchListener.h"
11 |
12 | #define defaultCenter [NSNotificationCenter defaultCenter]
13 |
14 | NSString * const KKAudioControlVolumeBiggerNotification = @"KKAudioControlVolumeBiggerNotification";
15 | NSString * const KKAudioControlVolumeSmallerNotification = @"KKAudioControlVolumeSmallerNotification";
16 | NSString * const KKAudioControlMuteTurnOnNotification = @"KKAudioControlMuteTurnOnNotification";
17 | NSString * const KKAudioControlMuteTurnOffNotification = @"KKAudioControlMuteTurnOffNotification";
18 |
19 | @interface KKAudioControlManager()
20 |
21 | @property (nonatomic, strong) KKVolumeProgressWindow *volumeView;
22 | @property (nonatomic, strong) KKMuteSwitchListener *muteListener;
23 |
24 | @end
25 |
26 | @implementation KKAudioControlManager
27 |
28 | static KKAudioControlManager* _instance;
29 |
30 | + (instancetype)shareInstance{
31 | static dispatch_once_t onceToken;
32 | dispatch_once(&onceToken, ^{
33 | _instance = [KKAudioControlManager new];
34 | });
35 | return _instance;
36 | }
37 |
38 | - (KKVolumeProgressWindow *)volumeView
39 | {
40 | if (!_volumeView) {
41 | _volumeView = [KKVolumeProgressWindow defaultVolumeView];
42 | _volumeView.delegate = self;
43 | }
44 | return _volumeView;
45 | }
46 |
47 | - (KKMuteSwitchListener *)muteListener
48 | {
49 | if (!_muteListener) {
50 | _muteListener = [KKMuteSwitchListener shareInstance];
51 | }
52 | return _muteListener;
53 | }
54 |
55 | #pragma mark - volume
56 |
57 | - (void)addVolumeListener
58 | {
59 | self.volumeView.hidden = NO;
60 | }
61 |
62 | - (void)removeVolumeListener
63 | {
64 | self.volumeView.hidden = YES;
65 | [self.volumeView removeAllAudioListen];
66 | _volumeView = nil;
67 | }
68 |
69 | #pragma mark - mute
70 |
71 | - (void)addMuteListener
72 | {
73 | __weak typeof (self) weakSelf = self;
74 | self.muteListener.muteListenerBlock = ^(BOOL isMute){
75 | if (isMute) {
76 | [weakSelf muteSwitchTurnOff];
77 | }else{
78 | [weakSelf muteSwitchTurnOn];
79 | }
80 | };
81 | self.muteListener.shouldBreak = NO;
82 | }
83 |
84 | - (void)removeMuteListener
85 | {
86 | self.muteListener.muteListenerBlock = nil;
87 | self.muteListener.shouldBreak = YES;
88 | }
89 |
90 | #pragma mark - volumedelegate
91 |
92 | - (void)volumeView:(KKVolumeProgressWindow *)volumeView willChangeValue:(CGFloat)value oldValue:(CGFloat)oldValue
93 | {
94 | if (oldValue > value) {
95 | [defaultCenter postNotificationName:KKAudioControlVolumeSmallerNotification object:nil];
96 | }else if ( oldValue < value || value == 1){
97 | [defaultCenter postNotificationName:KKAudioControlVolumeBiggerNotification object:nil];
98 | }
99 | }
100 |
101 | - (void)volumeView:(KKVolumeProgressWindow *)volumeView didChangeValue:(CGFloat)value oldValue:(CGFloat)oldValue
102 | {
103 |
104 | }
105 |
106 | - (void)muteSwitchTurnOn{
107 | [defaultCenter postNotificationName:KKAudioControlMuteTurnOnNotification object:nil];
108 | }
109 |
110 | - (void)muteSwitchTurnOff{
111 | [defaultCenter postNotificationName:KKAudioControlMuteTurnOffNotification object:nil];
112 | }
113 |
114 | @end
115 |
--------------------------------------------------------------------------------
/testAudioListen.xcodeproj/xcuserdata/kevin.xcuserdatad/xcschemes/testAudioListen.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
39 |
40 |
41 |
42 |
43 |
44 |
54 |
56 |
62 |
63 |
64 |
65 |
66 |
67 |
73 |
75 |
81 |
82 |
83 |
84 |
86 |
87 |
90 |
91 |
92 |
--------------------------------------------------------------------------------
/testAudioListen/KKAudioControl/KKMuteSwitchListener.m:
--------------------------------------------------------------------------------
1 | //
2 | // KKMuteSwitchListener.m
3 | //
4 | // Created by nice on 16/7/19.
5 | // Copyright © 2016年 kk. All rights reserved.
6 | //
7 |
8 | #import "KKMuteSwitchListener.h"
9 | #import
10 |
11 | void KKMuteSwitchListenerNotificationCompletionProc(SystemSoundID ssID,void* clientData);
12 |
13 | @interface KKMuteSwitchListener()
14 |
15 | @property (nonatomic, assign) NSTimeInterval interval;
16 | @property (nonatomic, assign) SystemSoundID soundId;
17 | @property (nonatomic, assign) BOOL isPaused;
18 | @property (nonatomic, assign) BOOL isPlaying;
19 |
20 | - (void)complete;
21 |
22 | @end
23 |
24 | void KKMuteSwitchListenerNotificationCompletionProc(SystemSoundID ssID,void* clientData){
25 | KKMuteSwitchListener* detecotr = (__bridge KKMuteSwitchListener*)clientData;
26 | [detecotr complete];
27 | }
28 |
29 | @implementation KKMuteSwitchListener
30 |
31 | - (void)dealloc{
32 | if (self.soundId != -1){
33 | AudioServicesRemoveSystemSoundCompletion(self.soundId);
34 | AudioServicesDisposeSystemSoundID(self.soundId);
35 | }
36 | [[NSNotificationCenter defaultCenter] removeObserver:self];
37 | }
38 |
39 | - (instancetype)init{
40 | if (self = [super init]){
41 | NSURL* url = [[NSBundle bundleWithPath:[[NSBundle mainBundle] pathForResource:@"KKMuteSwitchListener" ofType:@"bundle"]] URLForResource:@"silence" withExtension:@"mp3"];
42 | if (AudioServicesCreateSystemSoundID((__bridge CFURLRef)url, &_soundId) == kAudioServicesNoError){
43 | UInt32 yes = 1;
44 | AudioServicesAddSystemSoundCompletion(self.soundId,
45 | CFRunLoopGetMain(),
46 | kCFRunLoopCommonModes,
47 | KKMuteSwitchListenerNotificationCompletionProc,
48 | (__bridge void *)(self));
49 | AudioServicesSetProperty(kAudioServicesPropertyIsUISound,
50 | sizeof(_soundId),
51 | &_soundId,
52 | sizeof(yes),
53 | &yes);
54 | [self performSelector:@selector(loopCheck) withObject:nil afterDelay:1];
55 | } else {
56 | self.soundId = -1;
57 | }
58 |
59 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didEnterBackground) name:UIApplicationDidEnterBackgroundNotification object:nil];
60 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(willReturnToForeground) name:UIApplicationWillEnterForegroundNotification object:nil];
61 | }
62 | return self;
63 | }
64 |
65 | + (instancetype)shareInstance{
66 | static KKMuteSwitchListener* sShared = nil;
67 | if (!sShared)
68 | sShared = [KKMuteSwitchListener new];
69 | return sShared;
70 | }
71 |
72 | - (void)setMuteListenerBlock:(KKMuteSwitchListenerBlock)muteListenerBlock{
73 | _muteListenerBlock = muteListenerBlock;
74 | }
75 |
76 | - (void)scheduleCall{
77 | [[self class] cancelPreviousPerformRequestsWithTarget:self selector:@selector(loopCheck) object:nil];
78 | [self performSelector:@selector(loopCheck) withObject:nil afterDelay:1];
79 | }
80 |
81 | - (void)complete{
82 |
83 | if (self.shouldBreak) {
84 | return;
85 | }
86 |
87 | self.isPlaying = NO;
88 | NSTimeInterval elapsed = [NSDate timeIntervalSinceReferenceDate] - self.interval;
89 | BOOL isMute = elapsed < 0.16; // Should have been 0.5 sec, but it seems to return much faster (0.3something)
90 | if (self.isMute != isMute) {
91 | _isMute = isMute;
92 | if (self.muteListenerBlock)
93 | self.muteListenerBlock(isMute);
94 | }
95 | [self scheduleCall];
96 | }
97 |
98 | - (void)loopCheck{
99 | if (!self.isPaused){
100 | self.interval = [NSDate timeIntervalSinceReferenceDate];
101 | self.isPlaying = YES;
102 | AudioServicesPlaySystemSound(self.soundId);
103 | }
104 | }
105 |
106 | - (void)didEnterBackground{
107 | self.isPaused = YES;
108 | }
109 |
110 | - (void)willReturnToForeground{
111 | self.isPaused = NO;
112 | if (!self.isPlaying){
113 | [self scheduleCall];
114 | }
115 | }
116 |
117 | - (void)setShouldBreak:(BOOL)shouldBreak
118 | {
119 | _shouldBreak = shouldBreak;
120 | if (!shouldBreak) {
121 | [self scheduleCall];
122 | }
123 | }
124 |
125 | @end
126 |
--------------------------------------------------------------------------------
/testAudioListen/KKAudioControl/KKAudioLongPressListener.m:
--------------------------------------------------------------------------------
1 | //
2 | // KKAudioLongPressListener.m
3 | // KKShopping
4 | //
5 | // Created by nice on 16/8/24.
6 | // Copyright © 2016年 nice. All rights reserved.
7 | //
8 |
9 | #import "KKAudioLongPressListener.h"
10 | #import
11 | #import
12 |
13 | const NSTimeInterval longPressNeedContinuationMinTimerInterval = 0.2f;
14 | const NSTimeInterval longPressNeedRecognizeMinTimerInterval = 0.8f;
15 |
16 | NSString *const KKAudioShortClickNotification = @"KKAudioShortClickNotification";
17 | NSString *const KKAudioLongPressStartNotification = @"KKAudioLongPressStartNotification";
18 | NSString *const KKAudioLongPressEndNotification = @"KKAudioLongPressEndNotification";
19 |
20 | @interface KKAudioLongPressListener(){
21 | NSDate *_lastLongPressDate;
22 | NSInteger effectiveTimeCurrentClickCount;
23 | }
24 |
25 | @property (nonatomic, strong) MPVolumeView *volumeView;
26 | @property (nonatomic, weak) NSTimer *activeTimer;
27 | @property (nonatomic, weak) NSTimer *longPressEndTimer;
28 |
29 | @end
30 |
31 | @implementation KKAudioLongPressListener
32 |
33 | - (void)dealloc
34 | {
35 |
36 | }
37 |
38 | static KKAudioLongPressListener *_longPressListen;
39 |
40 | + (void)beginListen
41 | {
42 | _longPressListen = [[KKAudioLongPressListener alloc] init];
43 | [[UIApplication sharedApplication].keyWindow addSubview:_longPressListen];
44 | }
45 |
46 | + (void)stopListen
47 | {
48 | [_longPressListen removeAllAudioListen];
49 | [_longPressListen reset];
50 | [_longPressListen removeFromSuperview];
51 | _longPressListen = nil;
52 | }
53 |
54 | - (instancetype)initWithFrame:(CGRect)frame
55 | {
56 | if (self = [super initWithFrame:frame]) {
57 | [self addSubview:self.volumeView];
58 | [self regVolumeActive:YES];
59 | [self addApplicationStatusListen];
60 | _lastLongPressDate = [NSDate date];
61 | }
62 | return self;
63 | }
64 |
65 | - (MPVolumeView *)volumeView
66 | {
67 | if (!_volumeView) {
68 | _volumeView = [[MPVolumeView alloc] initWithFrame:CGRectMake(-500, 0, 1, 1)];
69 | }
70 | return _volumeView;
71 | }
72 |
73 | #pragma mark - audioListenValueChange
74 |
75 | - (void)volumeChanged:(NSNotification *)notification
76 | {
77 | NSString *str1 = [[notification userInfo]objectForKey:@"AVSystemController_AudioCategoryNotificationParameter"];
78 | NSString *str2 = [[notification userInfo]objectForKey:@"AVSystemController_AudioVolumeChangeReasonNotificationParameter"];
79 |
80 | if (([str1 isEqualToString:@"Audio/Video"] || [str1 isEqualToString:@"Ringtone"]) && ([str2 isEqualToString:@"ExplicitVolumeChange"]))
81 | {
82 | NSDate *now = [NSDate date];
83 | // if (!_lastLongPressDate) {
84 | // _lastLongPressDate = now;
85 | // if (!self.activeTimer) {
86 | // self.activeTimer = [NSTimer kk_scheduledTimerWithTimeInterval:longPressNeedRecognizeMinTimerInterval target:self selector:@selector(check) userInfo:nil repeats:NO];
87 | // }
88 | // return;
89 | // }
90 | NSTimeInterval interval = [now timeIntervalSinceDate:_lastLongPressDate];
91 | _lastLongPressDate = now;
92 | // NSLog(@"------------------------------>%f",interval);
93 |
94 | // if (interval > longPressNeedContinuationMinTimerInterval && effectiveTimeCurrentClickCount == 1) {
95 | // effectiveTimeCurrentClickCount = 0;
96 | // NSLog(@"------------------------------抛弃此次长按结果");
97 | // return;
98 | // }
99 |
100 | NSLog(@"\n--------------------->%f",interval);
101 |
102 | //两次按键间隔小于长按所需间隔即为连续长按
103 | if (interval < longPressNeedContinuationMinTimerInterval) {
104 | effectiveTimeCurrentClickCount = 1;
105 | self.longPressEndTimer = [NSTimer scheduledTimerWithTimeInterval:longPressNeedContinuationMinTimerInterval target:self selector:@selector(endLongPress) userInfo:nil repeats:NO];
106 | }else{ //短按
107 | effectiveTimeCurrentClickCount = 0;
108 | if (!self.activeTimer) {
109 | self.activeTimer = [NSTimer scheduledTimerWithTimeInterval:longPressNeedRecognizeMinTimerInterval target:self selector:@selector(check) userInfo:nil repeats:NO];
110 | }
111 | }
112 | }
113 | }
114 |
115 | - (void)setLongPressEndTimer:(NSTimer *)longPressEndTimer
116 | {
117 | if (_longPressEndTimer) {
118 | [_longPressEndTimer invalidate];
119 | _longPressEndTimer = nil;
120 | }
121 | _longPressEndTimer = longPressEndTimer;
122 |
123 | if (_longPressEndTimer) {
124 | [[NSRunLoop mainRunLoop] addTimer:_longPressEndTimer forMode:NSRunLoopCommonModes];
125 | }
126 | }
127 |
128 | - (void)check
129 | {
130 | if (effectiveTimeCurrentClickCount > 0) {
131 | NSLog(@"音量键-----------------------------长按开始");
132 | }else{
133 | NSLog(@"音量键-----------------------------短按");
134 | self.longPressEndTimer = nil;
135 | }
136 | [self reset];
137 | }
138 |
139 | - (void)endLongPress
140 | {
141 | NSLog(@"音量键-----------------------------长按结束");
142 | self.longPressEndTimer = nil;
143 | [self reset];
144 | }
145 |
146 | - (void)reset
147 | {
148 | [self.activeTimer invalidate];
149 | self.activeTimer = nil;
150 | effectiveTimeCurrentClickCount = 0;
151 | }
152 |
153 | #pragma mark - notification
154 |
155 | - (void)didEnterBackground:(NSNotification *)noti
156 | {
157 | [self regVolumeActive:NO];
158 | }
159 |
160 | - (void)willReturnToForeground:(NSNotification *)noti
161 | {
162 | [self regVolumeActive:YES];
163 | }
164 |
165 | - (void)willResignActive:(NSNotification *)noti
166 | {
167 | [self regVolumeActive:NO];
168 | }
169 |
170 | - (void)didBecomeActive:(NSNotification *)noti
171 | {
172 | [self regVolumeActive:YES];
173 | }
174 |
175 | - (void)regVolumeActive:(BOOL)isActive
176 | {
177 | NSError *activeError;
178 | [[AVAudioSession sharedInstance] setActive:isActive error:&activeError];
179 |
180 | if (!activeError) {
181 | if (isActive) {
182 | [self addVolumeListen];
183 | }else{
184 | [self removeVolumeListen];
185 | }
186 | }
187 | }
188 |
189 | #pragma mark - add || remove Listen
190 |
191 | - (void)removeVolumeListen
192 | {
193 | [[NSNotificationCenter defaultCenter] removeObserver:self
194 | name:@"AVSystemController_SystemVolumeDidChangeNotification"
195 | object:nil];
196 | }
197 |
198 | - (void)addVolumeListen
199 | {
200 | [self removeVolumeListen];
201 | [[NSNotificationCenter defaultCenter] addObserver:self
202 | selector:@selector(volumeChanged:)
203 | name:@"AVSystemController_SystemVolumeDidChangeNotification"
204 | object:nil];
205 | }
206 |
207 | - (void)addApplicationStatusListen
208 | {
209 | [[NSNotificationCenter defaultCenter] addObserver:self
210 | selector:@selector(didEnterBackground:)
211 | name:UIApplicationDidEnterBackgroundNotification
212 | object:nil];
213 | [[NSNotificationCenter defaultCenter] addObserver:self
214 | selector:@selector(willReturnToForeground:)
215 | name:UIApplicationWillEnterForegroundNotification
216 | object:nil];
217 | [[NSNotificationCenter defaultCenter] addObserver:self
218 | selector:@selector(willResignActive:)
219 | name:UIApplicationWillResignActiveNotification
220 | object:nil];
221 | [[NSNotificationCenter defaultCenter] addObserver:self
222 | selector:@selector(didBecomeActive:)
223 | name:UIApplicationDidBecomeActiveNotification
224 | object:nil];
225 | }
226 |
227 | - (void)removeAllAudioListen
228 | {
229 | [[UIApplication sharedApplication] endReceivingRemoteControlEvents];
230 | [[NSNotificationCenter defaultCenter] removeObserver:self];
231 | }
232 |
233 | @end
234 |
--------------------------------------------------------------------------------
/testAudioListen/KKAudioControl/KKVolumeProgressWindow.m:
--------------------------------------------------------------------------------
1 | //
2 | // KKVolumeView.m
3 | //
4 | // Created by nice on 16/7/19.
5 | // Copyright © 2016年 kk. All rights reserved.
6 | //
7 |
8 | #import "KKVolumeProgressWindow.h"
9 | #import
10 | #import
11 |
12 | const CGFloat height = 2;
13 | const CGFloat StatusHeight = 20;
14 | const CGFloat SidePadding = 10;
15 |
16 | @interface KKVolumeProgressWindow(){
17 | CGFloat _lastOldVolume;
18 | }
19 |
20 | @property (nonatomic, strong) MPVolumeView *volumeView;
21 | @property (nonatomic, strong) UIView *overlayView;
22 | @property (nonatomic, strong) UIView *backColorView;
23 | @property (nonatomic, strong) UIView *BGView;
24 | @property (nonatomic, assign) CGFloat volumeLevel;
25 |
26 | @end
27 |
28 | @implementation KKVolumeProgressWindow
29 |
30 | - (void)dealloc
31 | {
32 | [self removeAllAudioListen];
33 | }
34 |
35 | - (instancetype)initWithFrame:(CGRect)frame
36 | {
37 | if (self = [super initWithFrame:frame]) {
38 | [self setup];
39 | }
40 | return self;
41 | }
42 |
43 | #pragma mark - default
44 |
45 | + (instancetype)defaultVolumeView
46 | {
47 | KKVolumeProgressWindow *volume = [[KKVolumeProgressWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
48 | volume.frame = CGRectMake(0, 0, volume.frame.size.width, StatusHeight);
49 | volume.animationType = KKVolumeViewAnimationFade;
50 | volume.progressBarTintColor = [UIColor blackColor];
51 | volume.progressBarBackgroundColor = [UIColor whiteColor];
52 | volume.volumeStatusBackgroundColor = [UIColor lightGrayColor];
53 | return volume;
54 | }
55 |
56 | - (void)setup
57 | {
58 | [self regVolumeActive:YES];
59 |
60 | self.backgroundColor = [UIColor clearColor];
61 | self.windowLevel = UIWindowLevelStatusBar + 10.0f;
62 | self.userInteractionEnabled = NO;
63 | self.rootViewController = [[UIViewController alloc] init];
64 | self.rootViewController.view.backgroundColor = [UIColor clearColor];
65 |
66 | [self.volumeView setVolumeThumbImage:[[UIImage alloc] init] forState:UIControlStateNormal];
67 | self.volumeView.showsRouteButton = NO;
68 | self.BGView.backgroundColor = self.volumeStatusBackgroundColor?self.volumeStatusBackgroundColor : [UIColor whiteColor];
69 | self.backColorView.backgroundColor = self.progressBarBackgroundColor?self.progressBarBackgroundColor : [UIColor blackColor];
70 | self.overlayView.backgroundColor = self.progressBarTintColor?self.progressBarTintColor : [UIColor grayColor];
71 |
72 | [self addApplicationStatusListen];
73 | [self updateVolume:[AVAudioSession sharedInstance].outputVolume animated:NO];
74 | }
75 |
76 | #pragma mark - ui
77 |
78 | - (CGFloat)maxWidth
79 | {
80 | static CGFloat maxWidth = 0;
81 | if (maxWidth == 0) {
82 | maxWidth = [UIScreen mainScreen].bounds.size.width - SidePadding * 2;
83 | }
84 | return maxWidth;
85 | }
86 |
87 | - (MPVolumeView *)volumeView
88 | {
89 | if (!_volumeView) {
90 | _volumeView = [[MPVolumeView alloc] initWithFrame:CGRectZero];
91 | [self.rootViewController.view addSubview:_volumeView];
92 | }
93 | return _volumeView;
94 | }
95 |
96 | - (UIView *)overlayView
97 | {
98 | if (!_overlayView) {
99 | _overlayView = [[UIView alloc] initWithFrame:self.backColorView.bounds];
100 | [self.backColorView addSubview:_overlayView];
101 | }
102 | return _overlayView;
103 | }
104 |
105 | - (UIView *)backColorView
106 | {
107 | if (!_backColorView) {
108 | _backColorView = [[UIView alloc] initWithFrame:CGRectMake(SidePadding, (StatusHeight - height) * 0.5, [self maxWidth], height)];
109 | [self.BGView addSubview:_backColorView];
110 | }
111 | return _backColorView;
112 | }
113 |
114 | - (UIView *)BGView
115 | {
116 | if (!_BGView) {
117 | _BGView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, StatusHeight)];
118 | [self.rootViewController.view addSubview:_BGView];
119 | _BGView.transform = CGAffineTransformMakeTranslation(0, -StatusHeight);
120 | }
121 | return _BGView;
122 | }
123 |
124 | - (void)setAnimationType:(KKVolumeViewAnimation)animationType
125 | {
126 | _animationType = animationType;
127 | [self updateVolume:self.volumeLevel animated:NO];
128 | }
129 |
130 | - (void)setProgressBarTintColor:(UIColor *)progressBarTintColor
131 | {
132 | _progressBarTintColor = progressBarTintColor;
133 | self.overlayView.backgroundColor = progressBarTintColor;
134 | }
135 |
136 | - (void)setProgressBarBackgroundColor:(UIColor *)progressBarBackgroundColor
137 | {
138 | _progressBarBackgroundColor = progressBarBackgroundColor;
139 | self.backColorView.backgroundColor = progressBarBackgroundColor;
140 | }
141 |
142 | - (void)setVolumeStatusBackgroundColor:(UIColor *)volumeStatusBackgroundColor
143 | {
144 | _volumeStatusBackgroundColor = volumeStatusBackgroundColor;
145 | self.BGView.backgroundColor = volumeStatusBackgroundColor;
146 | }
147 |
148 | - (void)layoutSubviews
149 | {
150 | [super layoutSubviews];
151 | [self updateVolumeViewWidth];
152 | }
153 |
154 | - (void)updateVolumeViewWidth
155 | {
156 | CGRect rect = self.overlayView.frame;
157 | rect = CGRectMake(rect.origin.x, rect.origin.y, [self maxWidth] * self.volumeLevel, rect.size.height);
158 | self.overlayView.frame = rect;
159 | }
160 |
161 | #pragma mark - method
162 |
163 | - (void)updateVolume:(CGFloat)volumeLevel animated:(BOOL)animated{
164 |
165 | if ([self.delegate respondsToSelector:@selector(volumeView:willChangeValue:oldValue:)]) {
166 | [self.delegate volumeView:self willChangeValue:volumeLevel oldValue:self.volumeLevel];
167 | }
168 | _lastOldVolume = self.volumeLevel;
169 | self.volumeLevel = volumeLevel;
170 |
171 | [UIView animateWithDuration:animated?0.1:0 animations:^{
172 | [self updateVolumeViewWidth];
173 | }];
174 |
175 | [UIView animateKeyframesWithDuration:animated ? 2 : 0 delay:0 options:UIViewKeyframeAnimationOptionBeginFromCurrentState animations:^{
176 | [UIView addKeyframeWithRelativeStartTime:0 relativeDuration:0 animations:^{
177 | switch (self.animationType) {
178 | case KKVolumeViewAnimationNone:
179 | break;
180 | case KKVolumeViewAnimationFade:
181 | self.alpha = 1;
182 | case KKVolumeViewAnimationSlideDown:
183 | self.BGView.transform = CGAffineTransformIdentity;
184 | break;
185 | }
186 | }];
187 |
188 | [UIView addKeyframeWithRelativeStartTime:0.9 relativeDuration:0.1 animations:^{
189 | switch (self.animationType) {
190 | case KKVolumeViewAnimationNone:
191 | break;
192 | case KKVolumeViewAnimationFade:
193 | self.alpha = 0.0001;
194 | break;
195 | case KKVolumeViewAnimationSlideDown:
196 | self.BGView.transform = CGAffineTransformMakeTranslation(0, -StatusHeight);
197 | break;
198 | }
199 | }];
200 | } completion:^(BOOL finished) {
201 | if ([self.delegate respondsToSelector:@selector(volumeView:didChangeValue:oldValue:)]) {
202 | [self.delegate volumeView:self didChangeValue:volumeLevel oldValue:_lastOldVolume];
203 | }
204 | }];
205 | }
206 |
207 | #pragma mark - audioListenValueChange
208 |
209 | - (void)volumeChanged:(NSNotification *)notification
210 | {
211 | float volume = [[[notification userInfo] objectForKey:@"AVSystemController_AudioVolumeNotificationParameter"] floatValue];
212 |
213 | NSString *str1 = [[notification userInfo]objectForKey:@"AVSystemController_AudioCategoryNotificationParameter"];
214 | NSString *str2 = [[notification userInfo]objectForKey:@"AVSystemController_AudioVolumeChangeReasonNotificationParameter"];
215 |
216 | if (([str1 isEqualToString:@"Audio/Video"] || [str1 isEqualToString:@"Ringtone"]) && ([str2 isEqualToString:@"ExplicitVolumeChange"]))
217 | {
218 | [self updateVolume:volume animated:YES];
219 | }
220 | }
221 |
222 | - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context
223 | {
224 | if (object == [AVAudioSession sharedInstance] && [keyPath isEqualToString:@"outputVolume"]) {
225 | float new = [change[@"new"] floatValue];
226 |
227 | [self updateVolume:new animated:YES];
228 | }
229 | }
230 |
231 | - (void)didEnterBackground:(NSNotification *)noti
232 | {
233 | [self regVolumeActive:NO];
234 | }
235 |
236 | - (void)willReturnToForeground:(NSNotification *)noti
237 | {
238 | [self regVolumeActive:YES];
239 | }
240 |
241 | - (void)willResignActive:(NSNotification *)noti
242 | {
243 | [self regVolumeActive:NO];
244 | }
245 |
246 | - (void)didBecomeActive:(NSNotification *)noti
247 | {
248 | [self regVolumeActive:YES];
249 | }
250 |
251 | - (void)regVolumeActive:(BOOL)isActive
252 | {
253 | NSError *activeError,*categoryError;
254 | // [[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback
255 | // withOptions:AVAudioSessionCategoryOptionMixWithOthers
256 | // error:&categoryError];
257 | // [[AVAudioSession sharedInstance] setActive:isActive error:&activeError];
258 |
259 | if (!activeError) {
260 | if (isActive) {
261 | [self addVolumeListen];
262 | }else{
263 | [self removeVolumeListen];
264 | }
265 | }
266 | }
267 |
268 | #pragma mark - add || remove Listen
269 |
270 | - (void)removeVolumeListen
271 | {
272 | [[NSNotificationCenter defaultCenter] removeObserver:self
273 | name:@"AVSystemController_SystemVolumeDidChangeNotification"
274 | object:nil];
275 | }
276 |
277 | - (void)addVolumeListen
278 | {
279 | [self removeVolumeListen];
280 | [[NSNotificationCenter defaultCenter] addObserver:self
281 | selector:@selector(volumeChanged:)
282 | name:@"AVSystemController_SystemVolumeDidChangeNotification"
283 | object:nil];
284 | }
285 |
286 | - (void)addApplicationStatusListen
287 | {
288 | [[NSNotificationCenter defaultCenter] addObserver:self
289 | selector:@selector(didEnterBackground:)
290 | name:UIApplicationDidEnterBackgroundNotification
291 | object:nil];
292 | [[NSNotificationCenter defaultCenter] addObserver:self
293 | selector:@selector(willReturnToForeground:)
294 | name:UIApplicationWillEnterForegroundNotification
295 | object:nil];
296 | [[NSNotificationCenter defaultCenter] addObserver:self
297 | selector:@selector(willResignActive:)
298 | name:UIApplicationWillResignActiveNotification
299 | object:nil];
300 | [[NSNotificationCenter defaultCenter] addObserver:self
301 | selector:@selector(didBecomeActive:)
302 | name:UIApplicationDidBecomeActiveNotification
303 | object:nil];
304 | }
305 |
306 | - (void)removeAllAudioListen
307 | {
308 | [[NSNotificationCenter defaultCenter] removeObserver:self];
309 | }
310 |
311 | @end
312 |
--------------------------------------------------------------------------------
/testAudioListen.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 0681FC481D3E3C8300AEFD20 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 0681FC471D3E3C8300AEFD20 /* main.m */; };
11 | 0681FC4B1D3E3C8300AEFD20 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 0681FC4A1D3E3C8300AEFD20 /* AppDelegate.m */; };
12 | 0681FC4E1D3E3C8300AEFD20 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 0681FC4D1D3E3C8300AEFD20 /* ViewController.m */; };
13 | 0681FC511D3E3C8300AEFD20 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 0681FC4F1D3E3C8300AEFD20 /* Main.storyboard */; };
14 | 0681FC531D3E3C8300AEFD20 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 0681FC521D3E3C8300AEFD20 /* Assets.xcassets */; };
15 | 0681FC561D3E3C8300AEFD20 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 0681FC541D3E3C8300AEFD20 /* LaunchScreen.storyboard */; };
16 | 0A9965941DB5FCD300CA54F7 /* KKAudioControlManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 0A99658C1DB5FCD300CA54F7 /* KKAudioControlManager.m */; };
17 | 0A9965951DB5FCD300CA54F7 /* KKAudioLongPressListener.m in Sources */ = {isa = PBXBuildFile; fileRef = 0A99658E1DB5FCD300CA54F7 /* KKAudioLongPressListener.m */; };
18 | 0A9965961DB5FCD300CA54F7 /* KKMuteSwitchListener.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 0A99658F1DB5FCD300CA54F7 /* KKMuteSwitchListener.bundle */; };
19 | 0A9965971DB5FCD300CA54F7 /* KKMuteSwitchListener.m in Sources */ = {isa = PBXBuildFile; fileRef = 0A9965911DB5FCD300CA54F7 /* KKMuteSwitchListener.m */; };
20 | 0A9965981DB5FCD300CA54F7 /* KKVolumeProgressWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = 0A9965931DB5FCD300CA54F7 /* KKVolumeProgressWindow.m */; };
21 | /* End PBXBuildFile section */
22 |
23 | /* Begin PBXFileReference section */
24 | 0681FC431D3E3C8300AEFD20 /* testAudioListen.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testAudioListen.app; sourceTree = BUILT_PRODUCTS_DIR; };
25 | 0681FC471D3E3C8300AEFD20 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; };
26 | 0681FC491D3E3C8300AEFD20 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; };
27 | 0681FC4A1D3E3C8300AEFD20 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; };
28 | 0681FC4C1D3E3C8300AEFD20 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; };
29 | 0681FC4D1D3E3C8300AEFD20 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; };
30 | 0681FC501D3E3C8300AEFD20 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
31 | 0681FC521D3E3C8300AEFD20 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
32 | 0681FC551D3E3C8300AEFD20 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; };
33 | 0681FC571D3E3C8300AEFD20 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
34 | 0A99658B1DB5FCD300CA54F7 /* KKAudioControlManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KKAudioControlManager.h; sourceTree = ""; };
35 | 0A99658C1DB5FCD300CA54F7 /* KKAudioControlManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KKAudioControlManager.m; sourceTree = ""; };
36 | 0A99658D1DB5FCD300CA54F7 /* KKAudioLongPressListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KKAudioLongPressListener.h; sourceTree = ""; };
37 | 0A99658E1DB5FCD300CA54F7 /* KKAudioLongPressListener.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KKAudioLongPressListener.m; sourceTree = ""; };
38 | 0A99658F1DB5FCD300CA54F7 /* KKMuteSwitchListener.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = KKMuteSwitchListener.bundle; sourceTree = ""; };
39 | 0A9965901DB5FCD300CA54F7 /* KKMuteSwitchListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KKMuteSwitchListener.h; sourceTree = ""; };
40 | 0A9965911DB5FCD300CA54F7 /* KKMuteSwitchListener.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KKMuteSwitchListener.m; sourceTree = ""; };
41 | 0A9965921DB5FCD300CA54F7 /* KKVolumeProgressWindow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KKVolumeProgressWindow.h; sourceTree = ""; };
42 | 0A9965931DB5FCD300CA54F7 /* KKVolumeProgressWindow.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KKVolumeProgressWindow.m; sourceTree = ""; };
43 | /* End PBXFileReference section */
44 |
45 | /* Begin PBXFrameworksBuildPhase section */
46 | 0681FC401D3E3C8300AEFD20 /* Frameworks */ = {
47 | isa = PBXFrameworksBuildPhase;
48 | buildActionMask = 2147483647;
49 | files = (
50 | );
51 | runOnlyForDeploymentPostprocessing = 0;
52 | };
53 | /* End PBXFrameworksBuildPhase section */
54 |
55 | /* Begin PBXGroup section */
56 | 0681FC3A1D3E3C8300AEFD20 = {
57 | isa = PBXGroup;
58 | children = (
59 | 0681FC451D3E3C8300AEFD20 /* testAudioListen */,
60 | 0681FC441D3E3C8300AEFD20 /* Products */,
61 | );
62 | sourceTree = "";
63 | };
64 | 0681FC441D3E3C8300AEFD20 /* Products */ = {
65 | isa = PBXGroup;
66 | children = (
67 | 0681FC431D3E3C8300AEFD20 /* testAudioListen.app */,
68 | );
69 | name = Products;
70 | sourceTree = "";
71 | };
72 | 0681FC451D3E3C8300AEFD20 /* testAudioListen */ = {
73 | isa = PBXGroup;
74 | children = (
75 | 0681FC491D3E3C8300AEFD20 /* AppDelegate.h */,
76 | 0681FC4A1D3E3C8300AEFD20 /* AppDelegate.m */,
77 | 0681FC4C1D3E3C8300AEFD20 /* ViewController.h */,
78 | 0681FC4D1D3E3C8300AEFD20 /* ViewController.m */,
79 | 0A99658A1DB5FCD300CA54F7 /* KKAudioControl */,
80 | 0681FC4F1D3E3C8300AEFD20 /* Main.storyboard */,
81 | 0681FC521D3E3C8300AEFD20 /* Assets.xcassets */,
82 | 0681FC541D3E3C8300AEFD20 /* LaunchScreen.storyboard */,
83 | 0681FC571D3E3C8300AEFD20 /* Info.plist */,
84 | 0681FC461D3E3C8300AEFD20 /* Supporting Files */,
85 | );
86 | path = testAudioListen;
87 | sourceTree = "";
88 | };
89 | 0681FC461D3E3C8300AEFD20 /* Supporting Files */ = {
90 | isa = PBXGroup;
91 | children = (
92 | 0681FC471D3E3C8300AEFD20 /* main.m */,
93 | );
94 | name = "Supporting Files";
95 | sourceTree = "";
96 | };
97 | 0A99658A1DB5FCD300CA54F7 /* KKAudioControl */ = {
98 | isa = PBXGroup;
99 | children = (
100 | 0A99658B1DB5FCD300CA54F7 /* KKAudioControlManager.h */,
101 | 0A99658C1DB5FCD300CA54F7 /* KKAudioControlManager.m */,
102 | 0A99658D1DB5FCD300CA54F7 /* KKAudioLongPressListener.h */,
103 | 0A99658E1DB5FCD300CA54F7 /* KKAudioLongPressListener.m */,
104 | 0A9965901DB5FCD300CA54F7 /* KKMuteSwitchListener.h */,
105 | 0A9965911DB5FCD300CA54F7 /* KKMuteSwitchListener.m */,
106 | 0A9965921DB5FCD300CA54F7 /* KKVolumeProgressWindow.h */,
107 | 0A9965931DB5FCD300CA54F7 /* KKVolumeProgressWindow.m */,
108 | 0A99658F1DB5FCD300CA54F7 /* KKMuteSwitchListener.bundle */,
109 | );
110 | path = KKAudioControl;
111 | sourceTree = "";
112 | };
113 | /* End PBXGroup section */
114 |
115 | /* Begin PBXNativeTarget section */
116 | 0681FC421D3E3C8300AEFD20 /* testAudioListen */ = {
117 | isa = PBXNativeTarget;
118 | buildConfigurationList = 0681FC5A1D3E3C8300AEFD20 /* Build configuration list for PBXNativeTarget "testAudioListen" */;
119 | buildPhases = (
120 | 0681FC3F1D3E3C8300AEFD20 /* Sources */,
121 | 0681FC401D3E3C8300AEFD20 /* Frameworks */,
122 | 0681FC411D3E3C8300AEFD20 /* Resources */,
123 | );
124 | buildRules = (
125 | );
126 | dependencies = (
127 | );
128 | name = testAudioListen;
129 | productName = testAudioListen;
130 | productReference = 0681FC431D3E3C8300AEFD20 /* testAudioListen.app */;
131 | productType = "com.apple.product-type.application";
132 | };
133 | /* End PBXNativeTarget section */
134 |
135 | /* Begin PBXProject section */
136 | 0681FC3B1D3E3C8300AEFD20 /* Project object */ = {
137 | isa = PBXProject;
138 | attributes = {
139 | LastUpgradeCheck = 0730;
140 | ORGANIZATIONNAME = kk;
141 | TargetAttributes = {
142 | 0681FC421D3E3C8300AEFD20 = {
143 | CreatedOnToolsVersion = 7.3.1;
144 | DevelopmentTeam = 9437NAGUWD;
145 | ProvisioningStyle = Manual;
146 | };
147 | };
148 | };
149 | buildConfigurationList = 0681FC3E1D3E3C8300AEFD20 /* Build configuration list for PBXProject "testAudioListen" */;
150 | compatibilityVersion = "Xcode 3.2";
151 | developmentRegion = English;
152 | hasScannedForEncodings = 0;
153 | knownRegions = (
154 | en,
155 | Base,
156 | );
157 | mainGroup = 0681FC3A1D3E3C8300AEFD20;
158 | productRefGroup = 0681FC441D3E3C8300AEFD20 /* Products */;
159 | projectDirPath = "";
160 | projectRoot = "";
161 | targets = (
162 | 0681FC421D3E3C8300AEFD20 /* testAudioListen */,
163 | );
164 | };
165 | /* End PBXProject section */
166 |
167 | /* Begin PBXResourcesBuildPhase section */
168 | 0681FC411D3E3C8300AEFD20 /* Resources */ = {
169 | isa = PBXResourcesBuildPhase;
170 | buildActionMask = 2147483647;
171 | files = (
172 | 0A9965961DB5FCD300CA54F7 /* KKMuteSwitchListener.bundle in Resources */,
173 | 0681FC561D3E3C8300AEFD20 /* LaunchScreen.storyboard in Resources */,
174 | 0681FC531D3E3C8300AEFD20 /* Assets.xcassets in Resources */,
175 | 0681FC511D3E3C8300AEFD20 /* Main.storyboard in Resources */,
176 | );
177 | runOnlyForDeploymentPostprocessing = 0;
178 | };
179 | /* End PBXResourcesBuildPhase section */
180 |
181 | /* Begin PBXSourcesBuildPhase section */
182 | 0681FC3F1D3E3C8300AEFD20 /* Sources */ = {
183 | isa = PBXSourcesBuildPhase;
184 | buildActionMask = 2147483647;
185 | files = (
186 | 0A9965981DB5FCD300CA54F7 /* KKVolumeProgressWindow.m in Sources */,
187 | 0681FC4E1D3E3C8300AEFD20 /* ViewController.m in Sources */,
188 | 0681FC4B1D3E3C8300AEFD20 /* AppDelegate.m in Sources */,
189 | 0A9965951DB5FCD300CA54F7 /* KKAudioLongPressListener.m in Sources */,
190 | 0A9965941DB5FCD300CA54F7 /* KKAudioControlManager.m in Sources */,
191 | 0A9965971DB5FCD300CA54F7 /* KKMuteSwitchListener.m in Sources */,
192 | 0681FC481D3E3C8300AEFD20 /* main.m in Sources */,
193 | );
194 | runOnlyForDeploymentPostprocessing = 0;
195 | };
196 | /* End PBXSourcesBuildPhase section */
197 |
198 | /* Begin PBXVariantGroup section */
199 | 0681FC4F1D3E3C8300AEFD20 /* Main.storyboard */ = {
200 | isa = PBXVariantGroup;
201 | children = (
202 | 0681FC501D3E3C8300AEFD20 /* Base */,
203 | );
204 | name = Main.storyboard;
205 | sourceTree = "";
206 | };
207 | 0681FC541D3E3C8300AEFD20 /* LaunchScreen.storyboard */ = {
208 | isa = PBXVariantGroup;
209 | children = (
210 | 0681FC551D3E3C8300AEFD20 /* Base */,
211 | );
212 | name = LaunchScreen.storyboard;
213 | sourceTree = "";
214 | };
215 | /* End PBXVariantGroup section */
216 |
217 | /* Begin XCBuildConfiguration section */
218 | 0681FC581D3E3C8300AEFD20 /* Debug */ = {
219 | isa = XCBuildConfiguration;
220 | buildSettings = {
221 | ALWAYS_SEARCH_USER_PATHS = NO;
222 | CLANG_ANALYZER_NONNULL = YES;
223 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
224 | CLANG_CXX_LIBRARY = "libc++";
225 | CLANG_ENABLE_MODULES = YES;
226 | CLANG_ENABLE_OBJC_ARC = YES;
227 | CLANG_WARN_BOOL_CONVERSION = YES;
228 | CLANG_WARN_CONSTANT_CONVERSION = YES;
229 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
230 | CLANG_WARN_EMPTY_BODY = YES;
231 | CLANG_WARN_ENUM_CONVERSION = YES;
232 | CLANG_WARN_INT_CONVERSION = YES;
233 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
234 | CLANG_WARN_UNREACHABLE_CODE = YES;
235 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
236 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
237 | COPY_PHASE_STRIP = NO;
238 | DEBUG_INFORMATION_FORMAT = dwarf;
239 | ENABLE_STRICT_OBJC_MSGSEND = YES;
240 | ENABLE_TESTABILITY = YES;
241 | GCC_C_LANGUAGE_STANDARD = gnu99;
242 | GCC_DYNAMIC_NO_PIC = NO;
243 | GCC_NO_COMMON_BLOCKS = YES;
244 | GCC_OPTIMIZATION_LEVEL = 0;
245 | GCC_PREPROCESSOR_DEFINITIONS = (
246 | "DEBUG=1",
247 | "$(inherited)",
248 | );
249 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
250 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
251 | GCC_WARN_UNDECLARED_SELECTOR = YES;
252 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
253 | GCC_WARN_UNUSED_FUNCTION = YES;
254 | GCC_WARN_UNUSED_VARIABLE = YES;
255 | IPHONEOS_DEPLOYMENT_TARGET = 9.3;
256 | MTL_ENABLE_DEBUG_INFO = YES;
257 | ONLY_ACTIVE_ARCH = YES;
258 | SDKROOT = iphoneos;
259 | TARGETED_DEVICE_FAMILY = "1,2";
260 | };
261 | name = Debug;
262 | };
263 | 0681FC591D3E3C8300AEFD20 /* Release */ = {
264 | isa = XCBuildConfiguration;
265 | buildSettings = {
266 | ALWAYS_SEARCH_USER_PATHS = NO;
267 | CLANG_ANALYZER_NONNULL = YES;
268 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
269 | CLANG_CXX_LIBRARY = "libc++";
270 | CLANG_ENABLE_MODULES = YES;
271 | CLANG_ENABLE_OBJC_ARC = YES;
272 | CLANG_WARN_BOOL_CONVERSION = YES;
273 | CLANG_WARN_CONSTANT_CONVERSION = YES;
274 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
275 | CLANG_WARN_EMPTY_BODY = YES;
276 | CLANG_WARN_ENUM_CONVERSION = YES;
277 | CLANG_WARN_INT_CONVERSION = YES;
278 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
279 | CLANG_WARN_UNREACHABLE_CODE = YES;
280 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
281 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
282 | COPY_PHASE_STRIP = NO;
283 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
284 | ENABLE_NS_ASSERTIONS = NO;
285 | ENABLE_STRICT_OBJC_MSGSEND = YES;
286 | GCC_C_LANGUAGE_STANDARD = gnu99;
287 | GCC_NO_COMMON_BLOCKS = YES;
288 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
289 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
290 | GCC_WARN_UNDECLARED_SELECTOR = YES;
291 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
292 | GCC_WARN_UNUSED_FUNCTION = YES;
293 | GCC_WARN_UNUSED_VARIABLE = YES;
294 | IPHONEOS_DEPLOYMENT_TARGET = 9.3;
295 | MTL_ENABLE_DEBUG_INFO = NO;
296 | SDKROOT = iphoneos;
297 | TARGETED_DEVICE_FAMILY = "1,2";
298 | VALIDATE_PRODUCT = YES;
299 | };
300 | name = Release;
301 | };
302 | 0681FC5B1D3E3C8300AEFD20 /* Debug */ = {
303 | isa = XCBuildConfiguration;
304 | buildSettings = {
305 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
306 | DEVELOPMENT_TEAM = 9437NAGUWD;
307 | INFOPLIST_FILE = testAudioListen/Info.plist;
308 | IPHONEOS_DEPLOYMENT_TARGET = 7.0;
309 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
310 | PRODUCT_BUNDLE_IDENTIFIER = kk.testAudioListen;
311 | PRODUCT_NAME = "$(TARGET_NAME)";
312 | PROVISIONING_PROFILE = "392f34f8-0a45-4940-9cff-94a160c83135";
313 | PROVISIONING_PROFILE_SPECIFIER = dev_all;
314 | };
315 | name = Debug;
316 | };
317 | 0681FC5C1D3E3C8300AEFD20 /* Release */ = {
318 | isa = XCBuildConfiguration;
319 | buildSettings = {
320 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
321 | DEVELOPMENT_TEAM = "";
322 | INFOPLIST_FILE = testAudioListen/Info.plist;
323 | IPHONEOS_DEPLOYMENT_TARGET = 7.0;
324 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
325 | PRODUCT_BUNDLE_IDENTIFIER = kk.testAudioListen;
326 | PRODUCT_NAME = "$(TARGET_NAME)";
327 | };
328 | name = Release;
329 | };
330 | /* End XCBuildConfiguration section */
331 |
332 | /* Begin XCConfigurationList section */
333 | 0681FC3E1D3E3C8300AEFD20 /* Build configuration list for PBXProject "testAudioListen" */ = {
334 | isa = XCConfigurationList;
335 | buildConfigurations = (
336 | 0681FC581D3E3C8300AEFD20 /* Debug */,
337 | 0681FC591D3E3C8300AEFD20 /* Release */,
338 | );
339 | defaultConfigurationIsVisible = 0;
340 | defaultConfigurationName = Release;
341 | };
342 | 0681FC5A1D3E3C8300AEFD20 /* Build configuration list for PBXNativeTarget "testAudioListen" */ = {
343 | isa = XCConfigurationList;
344 | buildConfigurations = (
345 | 0681FC5B1D3E3C8300AEFD20 /* Debug */,
346 | 0681FC5C1D3E3C8300AEFD20 /* Release */,
347 | );
348 | defaultConfigurationIsVisible = 0;
349 | defaultConfigurationName = Release;
350 | };
351 | /* End XCConfigurationList section */
352 | };
353 | rootObject = 0681FC3B1D3E3C8300AEFD20 /* Project object */;
354 | }
355 |
--------------------------------------------------------------------------------