当前位置:网站首页>Dreamcamera2 record key prompt sound into video during video recording

Dreamcamera2 record key prompt sound into video during video recording

2022-06-26 02:38:00 bestwu0666

The camera records the key prompt sound into the video during video recording

[ANSWER]
1. Record the manual focusing sound into the video

FocusOverlayManager updateFocusFinsh Method Cancel the focusing sound during video recording

                 mFocusRing.startActiveFocusedFocus();
                 if (mFocusArea != null) {

                     if (mAppController.isPlaySoundEnable()) {
-                        mCameraSound.play(MediaActionSound.FOCUS_COMPLETE);
+                        if (!(mListener instanceof VideoModule && ((VideoModule) mListener).isRecording())) {
+                            mCameraSound.play(MediaActionSound.FOCUS_COMPLETE);
+                        }
                     }
                 } else {
                     mFocusRing.centerFocusLocation();

2. During the video recording, the prompt sound for starting the video recording will be recorded into the video

Add appropriate delay before starting recording , Make sure to start recording after the sound is released

  +++ b/src/com/android/camera/VideoModule.java
@@ -2810,6 +2810,13 @@ public class VideoModule extends CameraModule implements
                     // Fix bug 540246 recording and music work together after we end call
                     mActivity.sendBroadcast(new Intent(PAUSE_ACTION));
                 }

+                try {
    
+                    Thread.sleep(600);
+                } catch (Exception e){
    
+                    e.printStackTrace();
+                }

                 /*}@*/
 // if (useNewApi() && mShutterSoundEnable) {
    
 // if (mCameraSound != null) {
    

3. During the video recording process, the key prompt sound for taking photos and pausing will be recorded into the video

Cancel the prompt tone of taking pictures and pause key during recording

android:soundEffectsEnabled="false"
--- a/idh.code/vendor/sprd/platform/packages/apps/DreamCamera2/res/layout/dream_bottom_bar_contents.xml
+++ b/idh.code/vendor/sprd/platform/packages/apps/DreamCamera2/res/layout/dream_bottom_bar_contents.xml
@@ -38,6 +38,7 @@
 android:background="#ff0000" -->
             <com.android.camera.ui.RotateImageView
                 android:id="@+id/video_capture_button"
+               android:soundEffectsEnabled="false"
                 android:layout_width="48dp"
                 android:layout_height="48dp"
                 android:layout_gravity="center"
@@ -112,6 +113,7 @@ android:background="#ff0000" -->
 
             <com.android.camera.ui.RotateImageView
                 android:id="@+id/btn_video_pause"
+               android:soundEffectsEnabled="false"
                 android:layout_width="48dp"
                 android:layout_height="48dp"
                 android:layout_gravity="center"
原网站

版权声明
本文为[bestwu0666]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202180548060676.html