Skip to content

Disable the sound of the record button #13

Description

@sdroider

I want to turn off the sound of pressing the record button. When you press the button, the sound "beep" occurs. How to turn off this sound?
If in the class CameraService.java remove mMediaRecorder.setAudioSource (MediaRecorder.AudioSource.MIC) then an error occurs!

FATAL EXCEPTION: main
Process: example.chatea.servicecamera, PID: 15568 java.lang.RuntimeException: Unable to start service example.chatea.servicecamera.CameraService@e8912c4 with null: java.lang.NullPointerException: Attempt to invoke virtual method 'int android.content.Intent.getIntExtra(java.lang.String, int)' on a null object reference
at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:3057)
at android.app.ActivityThread.access$2200(ActivityThread.java:165)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1467)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:150)
at android.app.ActivityThread.main(ActivityThread.java:5546)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:794)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:684)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'int android.content.Intent.getIntExtra(java.lang.String, int)' on a null object reference
at example.chatea.servicecamera.CameraService.onStartCommand(CameraService.java:89)
at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:3040)
at android.app.ActivityThread.access$2200(ActivityThread.java:165)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1467)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:150)
at android.app.ActivityThread.main(ActivityThread.java:5546)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:794)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:684)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions