Skip to content

[HELP] - Unable to Start recording due to not getting permissions #9

Closed

Description

@kbanta11

I need Help for :

  • Debugging my App ?

I keep getting this error when trying to start recording:
Unhandled Exception: PlatformException(SoundRecorder, Permissions, Error setting the AudioSource. Check that you have permission to use the microphone.)

I've checked in the the _initializeAndRun() portion of the record method and it looks like its succeeding as hasPermissions is true, but then I get this error return and the recording does not begin. I haven't been able to figure out where this is sending from or what is triggering this (or how to get this to trigger and ask for permissions). I have added the necessary permissions to the AndroidManifest files.

Activity

  1. added
    help wanted
    on Jun 17, 2020
  2. kbanta11 commented on Jun 18, 2020

    @kbanta11
    Author

    I was able to get this work my pulling in the permission_handler package and before calling the record method using that package to check for and ask for permissions for the microphone. I'm also not sure if this is intended or if there is a way to make this automatic. I'm willing to take a look (since this seems like it could be handled with pure dart) and try to implement this.

  3. bsutton commented on Jun 18, 2020

    @bsutton
    Owner

    Have a look at this doco:
    https://github.com/bsutton/sounds/wiki/SoundRecorder

    Look for the section on permissions.

    The intent is that you get the permission first. This gives you control over when the user interaction occurs.

  4. kbanta11 commented on Jun 18, 2020

    @kbanta11
    Author

    Updated documentation seems to cover it! Thank you! Is there any sense in having sounds handle it if the user hasn't yet (just check whether they have an undetermined status and prompt if so when we start the recorder)? Or do we (you mostly, since I'm no expert haha) think this will cause problems/not worth it?

  5. bsutton commented on Jun 18, 2020

    @bsutton
    Owner

    My logic was two fold.

    1. the dev needs control over when the request is made.
    2. minimize the no. of included packages to avoid Sounds being a source of dll hell. (e.g. they may need permissions in other parts of their app and they may need a specific version of a permission library).

    So the approach I took was to provide the callback, so they can do it as late as possible and to then provide examples of how to do it.

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

    help wanted

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions