Events
Power BI DataViz World Championships
Feb 14, 4 PM - Mar 31, 4 PM
With 4 chances to enter, you could win a conference package and make it to the LIVE Grand Finale in Las Vegas
Learn moreThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
A control that enables app users to record sounds from their device.
Use the Microphone control to capture audio with a device's microphone. The device must have a microphone and the user must authorize the app to use the microphone.
The most recently recorded audio clip is available through the Audio property. With this property, recorded audio can be:
Format of the recorded audio:
Captured media is referenced by a text string URI. For more information, read the data type documentation.
Note
The microphone control is supported only on Microsoft Edge based on Chromium, Chrome, and Firefox browsers; and Android and iOS devices. All other browsers and platforms will show a warning that some features of the app won't work.
The microphone control has these limitations:
Audio – The audio clip captured when the user records with the device's microphone.
Mic – Numeric ID of the microphone on a device that has more than one microphone.
OnStop – Actions to perform when the user stops recording with a microphone control.
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 – Actions to perform when the user selects a control.
OnStart – Actions to perform when the user starts to record with a microphone control.
PressedBorderColor – The color of a control's border when the user selects that control.
PressedColor – The color of text in a control when the user selects that control.
PressedFill – The background color of a control when the user selects that control.
Reset – Whether a control reverts to its default value.
TabIndex – Keyboard navigation order compared 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 or screen.
Y – The distance between the top edge of a control and the top edge of the parent container or screen.
In this example, we'll directly connect a Microphone control with an Audio control for immediate playback:
Add a Microphone control to your app.
Authorize the app to use device's microphone if prompted.
Add an Audio control to your app.
Set the Audio control's Media property to the formula:
Microphone1.Audio
Note
Replace microphone control name Microphone1 as appropriate.
Preview the app.
Select the Microphone control to begin recording.
Speak to record audio.
Select the Microphone control again to end the recording.
Select the Audio control to hear the recording.
In this example, we'll create a gallery of audio clips stored in a collection that can be individually selected for playback:
Add a Microphone control.
Set its OnStop property to this formula using the Collect function:
Collect( MySounds, MyMic.Audio )
Add a Gallery control, move it below MyMic.
Set the Items property for the gallery to this formula:
MySounds
In the template for the Custom gallery control, add an Audio control.
Set the audio control's Media property to this formula:
ThisItem.Url
Press F5 to preview the app.
Select MyMic to start recording, and then select it again to stop recording.
In the Gallery control, select the play button in the Audio control to play back your recording.
Add as many recordings as you want, and then return to the default workspace by pressing the Esc key.
(optional) In the template for the Gallery control, add a Button control.
Set its OnSelect property to the formula:
Remove( MySounds, ThisItem )
Press F5, and then remove a recording by selecting the corresponding Button control.
Use the SaveData function to save the recordings locally or the Patch function to update a data source.
The same guidelines for Button apply because Microphone is just a specialized button. Also, consider:
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.
Events
Power BI DataViz World Championships
Feb 14, 4 PM - Mar 31, 4 PM
With 4 chances to enter, you could win a conference package and make it to the LIVE Grand Finale in Las Vegas
Learn more