Skip to content

[camerax] enableAudio has no effect on video recording, can not mute video recording if microphone permission granted #168551

Closed
flutter/packages
#9264

Description

@mzdm

Steps to reproduce

  1. Clone camerax example app https://github.com/flutter/packages/tree/main/packages/camera/camera_android_camerax
  2. Enable camera and microphone permission via app settings
  3. Also observe that enableAudio in example has no effect, as its value does not get passed to CameraController's MediaSettings. Default is false.

So it always records audio when mic enabled, even though it is set to false. I tested on Android.

Expected results

Should not record audio if enableAudio is set to false

Actual results

Records microphone audio

Code sample

Code sample
[Paste your code here]

Screenshots or Video

Screenshots / Video demonstration

[Upload media here]

Logs

Logs
[Paste your logs here]

Flutter Doctor output

Doctor output
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.27.4, on macOS 15.3.1 24D70 darwin-arm64, locale en-CZ)
[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 16.2)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2024.1)
[✓] IntelliJ IDEA Ultimate Edition (version 2024.2.3)
[✓] VS Code (version 1.93.1)
[✓] Connected device (4 available)
[✓] Network resources

• No issues found!

Activity

  1. changed the title [-][camerax] enableAudio has no effect, can not mute video recording if microphone permission granted[/-] [+][camerax] `enableAudio` has no effect on video recording, can not mute video recording if microphone permission granted[/+] on May 8, 2025
  2. bparrishMines commented on May 8, 2025

    @bparrishMines
    Contributor
  3. darshankawar commented on May 9, 2025

    @darshankawar
    Member

    Thanks for the report. I was able to replicate the reported behavior with latest sdk versions.

    
    stable : 3.29.3
    master : 3.32.0-1.0.pre.463
    
  4. added
    platform-androidAndroid applications specifically
    has reproducible stepsThe issue has been confirmed reproducible and is ready to work on
    team-androidOwned by Android platform team
    and removed
    in triagePresently being triaged by the triage team
    on May 9, 2025
  5. camsim99 commented on May 12, 2025

    @camsim99
    Contributor

    The original implementation doesn't seem to include PendingRecording.withAudioEnabled: https://github.com/flutter/packages/blob/4a36dc63f7197f5cf4f0d0b9b670492b8848c502/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/PendingRecordingHostApiImpl.java#L20.

    Does this need to be added in or was audio disabled another way?

    Or does this setting only affect the permission request: https://github.com/flutter/packages/blob/main/packages/camera/camera_android_camerax/lib/src/android_camera_camerax.dart#L352

    Oh interesting. Yeah I think we need to use withAudioEnabled to support the enableAudio setting!

  6. added
    P1High-priority issues at the top of the work list
    triaged-androidTriaged by Android platform team
    on May 13, 2025
  7. reidbaker commented on May 13, 2025

    @reidbaker
    Contributor

    Thank you so much for this well written issue sorry this feature slipped through.

  8. added
    r: fixedIssue is closed as already fixed in a newer version
    on May 26, 2025
  9. github-actions commented on Jun 9, 2025

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  10. locked as resolved and limited conversation to collaborators on Jun 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P1High-priority issues at the top of the work listfound in release: 3.29Found to occur in 3.29found in release: 3.32Found to occur in 3.32has reproducible stepsThe issue has been confirmed reproducible and is ready to work onp: cameraThe camera pluginplatform-androidAndroid applications specificallyr: fixedIssue is closed as already fixed in a newer versionteam-androidOwned by Android platform teamtriaged-androidTriaged by Android platform team

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions