Microphone control in PowerApps

A control that allows app users to record sounds from their device.

Description

App users can make audio recordings if the device where the app is running has a microphone.

Audio is stored in 3gp format in Android, AAC format in iOS, and OGG format in web browsers.

Key properties

Mic – On a device that has more than one microphone, the numeric ID of the microphone that the app uses.

OnStop – How the app responds when the user stops recording with a microphone control.

Additional properties

AccessibleLabel – Label for screen readers. Should describe the purpose of the microphone.

BorderColor – The color of a control's border.

BorderStyle – Whether a control's border is Solid, Dashed, Dotted, or None.

BorderThickness – The thickness of a control's border.

Color – The color of text in a control.

DisplayMode – Whether the control allows user input (Edit), only displays data (View), or is disabled (Disabled).

DisabledBorderColor – The color of a control's border if the control's DisplayMode property is set to Disabled.

DisabledColor – The color of text in a control if its DisplayMode property is set to Disabled.

DisabledFill – The background color of a control if its DisplayMode property is set to Disabled.

Fill – The background color of a control.

FocusedBorderColor – The color of a control's border when the control is focused.

FocusedBorderThickness – The thickness of a control's border when the control is focused.

Height – The distance between a control's top and bottom edges.

HoverBorderColor – The color of a control's border when the user keeps the mouse pointer on that control.

HoverColor – The color of the text in a control when the user keeps the mouse pointer on it.

HoverFill – The background color of a control when the user keeps the mouse pointer on it.

Image – The name of the image that appears in an image, audio, or microphone control.

ImagePosition – The position (Fill, Fit, Stretch, Tile, or Center) of an image in a screen or a control if it isn't the same size as the image.

OnSelect – How the app responds when the user taps or clicks a control.

OnStart – How the app responds when the user starts to record with a microphone control.

PressedBorderColor – The color of a control's border when the user taps or clicks that control.

PressedColor – The color of text in a control when the user taps or clicks that control.

PressedFill – The background color of a control when the user taps or clicks that control.

Reset – Whether a control reverts to its default value.

TabIndex – Keyboard navigation order in relation to other controls.

Tooltip – Explanatory text that appears when the user hovers over a control.

Visible – Whether a control appears or is hidden.

Width – The distance between a control's left and right edges.

X – The distance between the left edge of a control and the left edge of its parent container (screen if no parent container).

Y – The distance between the top edge of a control and the top edge of the parent container (screen if no parent container).

Patch( DataSource, BaseRecord, ChangeRecord )

Example

  1. Add a Microphone, name it MyMic, and set its OnStop property to this formula:
    Collect(MySounds, MyMic.Audio)

    Don't know how to add, name, and configure a control?

    Want more information about the Collect function or other functions?

  2. Add a Custom gallery control, move it below MyMic, and set the Items property for the Custom gallery control to MySounds.

  3. In the template for the Custom gallery control, add an Audio control, and set its Media property to ThisItem.Url.

  4. Press F5, click or tap MyMic to start recording, and then click or tap it again to stop recording.

  5. In the Custom gallery control, click or tap the play button in the Audio control to play back your recording.

  6. Add as many recordings as you want, and then return to the default workspace by pressing Esc.

  7. (optional) In the template for the Custom gallery control, add a Button control, set its OnSelect property to Remove(MySounds, ThisItem), press F5, and then remove a recording by clicking or tapping the corresponding Button control.

Use the SaveData function to save the recordings locally or the Patch function to update a data source.

Accessibility guidelines

The same guidelines for Button apply because Microphone is just a specialized button. In addition, consider the following:

Audio alternatives

  • Consider adding an alternative form of input for users with speech disabilities or without a microphone. For example, Text input to allow users to enter text.

Color contrast

There must be adequate color contrast between:

  • Image and the button text and icon (if applicable)

This is in addition to the standard color contrast requirements.

Screen reader support