Power Apps Microphone Control [How to Use]

Are you required to work with a Microphone control in Power Apps? If yes, follow this complete Power Apps tutorial to overview Power Apps Microphone control and its key properties.

Moreover, I will explain how to add the Microphone control in Power Apps and how to work with a Power Apps Microphone control.

We will also learn how to save the recorded audio to a gallery control in Power Apps and delete recorded audio from a gallery control in Power Apps.

Power Apps Microphone Control

The Powerapps Microphone control is a control type that enables users to record various sounds or audio clips using their devices.

However, users must authorize the app to access the microphone before using this control. Additionally, the device must possess a microphone that the user intends to use.

Note,

If you wish to store the recorded audio data, you can store it in data sources such as SharePoint Online or PowerApps Collection.

Here are some methods to handle recorded audio clips in PowerApps:

  1. Storing in a database: If you want to store audio clips in a database, use the Power Apps Patch function.
  2. Transmitting as a base64 encoded text string: The JSON function converts audio clips to base64 encoding.
  3. Playing back with the Audio control: Use the Audio control to listen to the recently recorded audio clips.
  4. Temporarily stored in a collection or variable: Use the PowerApps Collect function to store audio clips temporarily. Similarly, use the Set function to store records in a Variable. The SaveData and LoadData functions help move audio clips to local storage.
Power Apps Microphone Control

Power Apps Microphone Control Properties

Here, I will explain the properties of Power Apps Microphone control.

PropertiesDescription
AccessibleLabelThis property is assigned to a screen reader label.
Border ColorA user can specify the color for a border.
Border StyleThis property specifies the type of border that the control should have [“Solid,” “Dashed,” “Dotted,” “None”].
ColorWe can define the text color of the control.
DisabledBorderColorWhen the DisplayMode property of the control is set to Disabled, it indicates a color for the control’s border.
DisplayModeDetermines whether it enables user input (Edit), only displays data (View), or is disabled (Disabled).
FillWe can define the background color of the control.
HoverBorderColorBorder color of a control when the user hovers their mouse pointer over it.
HoverColorColor of a text when the user hovers their mouse pointer over it.
ImageThis property specify the image name that appears in an image, audio, or microphone control.
MicRefer to the unique numerical identifier assigned to a microphone when a device has multiple microphones.
OnSelectWhen the user clicks on a control, it specifies what action to perform.
OnStartThe action should be taken when the user starts recording with a microphone control.
OnStopThe action should be taken when the user stops recording with a microphone control.
PressedColorWhen the user clicks on a control, specify the color of the text.
ResetThis property determines whether a control will reset to its default value.
TabIndexThis refers to the keyboard navigation sequence that is related to other controls.
VisibleHere, we can specify whether the Microphone control can be visible.
WidthThis refers to the measurement of the space between a control’s left and right edges.

These are the properties of Power Apps Microphone control.

How to add Power Apps Microphone Control

Here, I will show you how to insert microphone control in Power Apps:

  • Sign into Power Apps with your valid Microsoft 365 Credentials.
  • Create a Blank canvas app -> On the Power Apps screen, click +Insert -> Expand Media -> Select the Microphone Control.
Add Power Apps Microphone Control
  • The Power Apps Microphone Control will appear like the screenshot below.
How to add Power Apps microphone control
  • By default, the Microphone control name will be “Microphone1“; you can Rename the export control using “mic.”
Add Microphone Control in Power Apps

This is how to insert Power Apps Microphone Control.

How to use Power Apps Microphone Control

First, let me show you how to use the Power Apps Microphone control.

Example,

I created a Power Apps canvas app and then added a Power Apps Microphone and Audio control. When the user clicks on a microphone control, it will start to record audio, and that recorded audio will be stored in the audio control.

You can click on an audio control play button to listen to recorded audio.

How to work with Microphone control in Power Apps

Let me show you how to achieve this:

  • On the Power Apps screen, insert a Microphone control as shown below:
How to add Microphone Control in Power Apps
  • SavePublish, and Preview the app. When the user clicks on a control, the dialogue box will appear to ask permission; click the Allow button to “Use your Microphone.”
How to use Power Apps Microphone control
  • Then, record an audio by clicking on a control as shown below:
Use Power Apps Microphone control
  • To listen to recorded audio on the Power Apps screen, insert an Audio control -> Set its Media property to:
Mic_Recorded.Audio

Where,

  1. Mic_Recorded = Microphone control name
How to work with a Power Apps Microphone control
  • Once your app is ready, SavePublish, and Preview the app. The recorded audio will be played when the user clicks an audio control play button.
How to use Microphone control in Power Apps

This is how to work with a Power Apps Microphone control.

Add Recorded Audio to a Gallery control in Power Apps

In this section, I will show you how to save the recorded audio to a gallery control in Power Apps.

Example:

On the Power Apps screen, insert a Microphone and Gallery control. In the gallery control, I have added an Audio control. Whenever the user clicks on a microphone control to record audio, the recorded audio will be saved to a gallery control, as shown below:

Power Apps Add Recorded Audio to Gallery control

To achieve this, follow the below steps:

  • On the Power Apps screen, insert a Microphone control -> Set its OnStop property to:
Collect(
    colRecordedAudio,
    Mic_Gallery.Audio
);

Where,

  1. colRecordedAudio = Provide the collection name
  2. Mic_Gallery = Microphone control name
Add Recorded Audio to a Gallery control in Power Apps
  • Insert a Gallery control -> Set its Items property to:
colRecordedAudio

Where,

  1. colRecordedAudio = Collection name
How to add Recorded Audio to a Gallery control in Power Apps
  • Select the Gallery control, insert an Audio control -> Set its Media property to:
ThisItem.Value
How to save Recorded Audio to a Gallery control in Power Apps
  • Once your app is ready, SavePublish, and Preview the app. Record an audio by clicking on a Microphone control, and that recorded audio will be saved to a gallery control as shown below:
How to add Power Apps Recorded Audio to Gallery control

This is how to save the recorded audio to a gallery control in Power Apps.

Delete Recorded Audio from a Gallery control in Power Apps

Suppose you want to delete the recorded audio from a gallery control, you can follow the below steps:

  • Select the Gallery control -> Insert a Trash icon -> Set its OnSelect property to:
Remove(colRecordedAudio, ThisItem)

Where,

  1. colRecordedAudio = Collection name
Delete Recorded Audio from a Gallery control in Power Apps
  • SavePublish, and Preview the app. When a user clicks on the Trash icon associated with a specific audio from the gallery control, the corresponding recording will be deleted.
How to delete recorded audio from a gallery control in Power Apps

This is how to delete the recorded audio from a gallery control in Power Apps.

Conclusion

In this Power Apps tutorial, I explained Power Apps Microphone control and its key properties.

Also, we have learned to add the Power Apps Microphone control and how to use a Microphone control in Power Apps.

Lastly, I have covered how to save the recorded audio to a gallery control in Power Apps and delete recorded audio from a gallery control in Power Apps.

Additionally, you may like some more Power Apps tutorials: