Skip to content

Commit 01e55a3

Browse files
sumengsumeng
authored andcommitted
修复音量显示问题
1 parent d5071aa commit 01e55a3

3 files changed

Lines changed: 8 additions & 2 deletions

File tree

Coding_iOS/Util/Audio/AudioManager.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ - (void)updateMeter {
168168

169169
volume = pow(adjAmp, 1.0f / root);
170170
}
171-
NSLog(@"recording volume:%f", volume);
171+
172172
if (_delegate && [_delegate respondsToSelector:@selector(didAudioRecording:volume:)]) {
173173
[_delegate didAudioRecording:self volume:volume];
174174
}

Coding_iOS/Views/AudioView/AudioRecordView.m

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,12 @@ - (void)didAudioRecordStarted:(AudioManager *)am {
8787

8888
}
8989

90+
- (void)didAudioRecording:(AudioManager *)am volume:(double)volume {
91+
if (_delegate && [_delegate respondsToSelector:@selector(recordView:volume:)]) {
92+
[_delegate recordView:self volume:volume];
93+
}
94+
}
95+
9096
- (void)didAudioRecordStoped:(AudioManager *)am file:(NSString *)file duration:(NSTimeInterval)duration successfully:(BOOL)successfully {
9197
_isRecording = NO;
9298
if (_delegate && [_delegate respondsToSelector:@selector(recordViewRecordFinished:file:duration:)]) {

Coding_iOS/Views/AudioView/AudioVolumeView.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ - (instancetype)initWithFrame:(CGRect)frame {
2626
[_volumes addObject:@0];
2727

2828
UIView *volumeView = [[UIView alloc] initWithFrame:CGRectMake((kAudioVolumeViewVolumeWidth+kAudioVolumeViewVolumePadding)*i, (self.frame.size.height-kAudioVolumeViewVolumeMinHeight)/2, kAudioVolumeViewVolumeWidth, kAudioVolumeViewVolumeMinHeight)];
29-
volumeView.backgroundColor = [UIColor colorWithRGBHex:0x2faeea];
29+
volumeView.backgroundColor = [UIColor colorWithRGBHex:0xfb8638];
3030
volumeView.layer.cornerRadius = volumeView.frame.size.width/2;
3131
[self addSubview:volumeView];
3232
[_volumeViews addObject:volumeView];

0 commit comments

Comments
 (0)