Skip to content

Commit

Permalink
添加注释
Browse files Browse the repository at this point in the history
  • Loading branch information
NSSONGMENG committed Jun 22, 2016
1 parent 7f9553c commit da5fe9d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Voice Record/ChatVoiceManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ -(BOOL)canRecord{
}

-(void)levelTimer:(NSTimer*)timer{
//playName不正确会导致得录音失败,监测不到音量
//playName不正确或者不存在会导致得录音失败,监测不到音量
voiceTimeInterval += 0.1;
//call to refresh meter values刷新平均和峰值功率,此计数是以对数刻度计量的,-160表示完全安静,0表示最大输入值
[recorder updateMeters];
Expand All @@ -210,7 +210,7 @@ -(void)levelTimer:(NSTimer*)timer{
#pragma mark -------- notification --------
- (void)distanceChanged:(NSNotification *)notification{
NSLog(@" notification ");
//如果此时手机靠近面部放在耳朵旁,那么声音将通过听筒输出,并将屏幕变暗(省电啊)
//如果此时手机靠近面部放在耳朵旁,那么声音将通过听筒输出,并将屏幕变暗
if ([[UIDevice currentDevice] proximityState] == YES){
NSLog(@"Device is close to user");
[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayAndRecord error:nil];
Expand All @@ -224,9 +224,10 @@ - (void)distanceChanged:(NSNotification *)notification{
#pragma mark -
#pragma mark -------- delegate --------
- (void)audioRecorderDidFinishRecording:(AVAudioRecorder *)recorder successfully:(BOOL)flag{
NSLog(@" did finish recording");
NSLog(@" did finish recording __%s__",__func__);
}

//音频播放完成
- (void)audioPlayerDidFinishPlaying:(AVAudioPlayer *)player successfully:(BOOL)flag{
[[UIDevice currentDevice] setProximityMonitoringEnabled:NO];
if (self.voiceDidFinishPlaying) {
Expand Down

0 comments on commit da5fe9d

Please sign in to comment.