@@ -319,6 +319,10 @@ - (void)sendVoiceToServer:(NSString *)dev_name channel:(NSString *)channel_numbe
319319}
320320
321321- (void )sendVoiceToServer : (NSString *)dev_name channel : (NSString *)channel_number audioConfig : (TIoTAVCaptionFLVAudioType)audio_rate withLocalPreviewView : (UIView *)localView videoPosition : (AVCaptureDevicePosition)videoPosition {
322+ [self sendVoiceToServer: dev_name channel: channel_number audioConfig: audio_rate withLocalPreviewView: localView videoPosition: videoPosition isEchoCancel: NO ];
323+ }
324+
325+ - (void )sendVoiceToServer : (NSString *)dev_name channel : (NSString *)channel_number audioConfig : (TIoTAVCaptionFLVAudioType)audio_rate withLocalPreviewView : (UIView *)localView videoPosition : (AVCaptureDevicePosition)videoPosition isEchoCancel : (BOOL )isEchoCancel {
322326 NSString *audioFile = [[NSSearchPathForDirectoriesInDomains (NSDocumentDirectory, NSUserDomainMask, YES ) lastObject ] stringByAppendingPathComponent: @" testVideoStreamfile.flv" ];
323327 [[NSFileManager defaultManager ] removeItemAtPath: audioFile error: nil ];
324328 [[NSFileManager defaultManager ] createFileAtPath: audioFile contents: nil attributes: nil ];
@@ -334,7 +338,7 @@ - (void)sendVoiceToServer:(NSString *)dev_name channel:(NSString *)channel_numbe
334338 if (systemAvCapture == nil ) {
335339 systemAvCapture = [[TIoTAVCaptionFLV alloc ] initWithAudioConfig: audio_rate];
336340 systemAvCapture.videoLocalView = localView;
337- systemAvCapture.isEchoCancel = YES ;
341+ systemAvCapture.isEchoCancel = isEchoCancel ;
338342 }
339343 systemAvCapture.devicePosition = videoPosition;
340344 systemAvCapture.videoLocalView = localView;
@@ -367,7 +371,7 @@ - (void)getSendBufSize {
367371// for (int i =0; i < _p2p_wl_avg_ctx.len; i++) {
368372// printf("\n stream_buf_con==%d \n",_p2p_wl_avg_ctx.buf[i]);
369373// }
370- NSLog (@" send_bufsize==%d , now_video_rate==%d , avg_index==%d " ,bufsize, now_video_rate, p2p_wl_avg);
374+ // NSLog(@"send_bufsize==%d, now_video_rate==%d, avg_index==%d",bufsize, now_video_rate, p2p_wl_avg);
371375
372376 // 降码率
373377 // 当发现p2p的水线超过一定值时,降低视频码率,这是一个经验值,一般来说要大于 [视频码率/2]
0 commit comments