File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed
sdk/video-link-android/src/main/java/com/tencent/iot/video/link/util/audio Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -487,8 +487,12 @@ private boolean initAEC(int audioSession) {
487487 return false ;
488488 }
489489 canceler = AcousticEchoCanceler .create (audioSession );
490- canceler .setEnabled (true );
491- return canceler .getEnabled ();
490+ if (canceler != null ) {
491+ canceler .setEnabled (true );
492+ return canceler .getEnabled ();
493+ } else {
494+ return false ;
495+ }
492496 }
493497 public boolean isDevicesSupportAGC () {
494498 return AutomaticGainControl .isAvailable ();
@@ -503,8 +507,12 @@ private boolean initAGC(int audioSession) {
503507 return false ;
504508 }
505509 control = AutomaticGainControl .create (audioSession );
506- control .setEnabled (true );
507- return control .getEnabled ();
510+ if (control != null ) {
511+ control .setEnabled (true );
512+ return control .getEnabled ();
513+ } else {
514+ return false ;
515+ }
508516 }
509517
510518 private byte [] onReadPlayerPlayPcm (int length ) {
You can’t perform that action at this time.
0 commit comments