查看中文文档 Chinese README.md
E-mail:[email protected]
Detect iPhone is mute(silence) or not, detect once or keep detecting .
Download and Drag & Copy EBMuteDetector
file folder from root into you Xcode project.
only detect once, after calling the method, it will detect in 0.02~0.2 sec, when finished will run the block
.
use case: if it's not mute, play a short ring.
[EBMuteDetector detectComplete:^(BOOL isMute) {
if (isMute) {
NSLog(@"is mute");
}else{
NSLog(@"is not mute");
}
}];
keep detecting at intervals, then run the block
.
use case: when playing a music, if the mute changed, pause/resume the music.
[EBMuteDetector detecting:^(BOOL isMute) {
if (isMute) {
NSLog(@"is mute");
}else{
NSLog(@"is not mute");
}
}];
[EBMuteDetector pause];
[EBMuteDetector resume];
[EBMuteDetector vibrate];
EBMuteDetectorFrequency = 0.5; // secound, default is 1
set it first,then begin the loop it will works.
EBMuteDetector is released under the MIT license. See LICENSE for details.