Access storage when recording audio

I am building an app that records audio. When I click the record button (which starts the recording), it only asks to use the audio permission but it also should asks to use storage to save the audio file. How do I ask to use the storage permission?

Thanks in advance.

After the audio has been recorded, the file must be saved somewhere. Usually in: storage/emulated/0/myRecords/ (or …/Download/ or …/Music/ or …).
storage/emulated/0/ is the root directory of the SD card that requires WRITE_EXTERNAL_STORAGE permission. Therefore you / the user will be ask to grant this permission.

When I use the directories you suggested, it gives me an 802 error and says that there is no such folder. How can I make a prompt that asks for storage access?

Thanks for the help.

Show your (relevant) blocks.

1 Like

These are the blocks I’m using. I am using the sound recorder and button blocks.

If the folder does not exist, it first must be created. Use the File component for this:

1 Like

Note: You must ask for WRITE permission manually:

see here: File path for unzip file component

1 Like

Thanks for the quick reply. Can I ask for two permissions at once? Right now, if I ask to write external storage and use the microphone, it will only ask for the permission listed first.

Thanks for the help

See here:

1 Like