ArcGIS AppStudio provides a high-level recording component for handling audio, including functions to control and monitor the recording. This can be used to create powerful tools for collecting data in qualities and sizes configurable for your app's needs.
Recorder controls
The AudioRecorder component provides functions to control the audio recording process. The record, pause, and stop methods provide base-level tools that can be supplemented further by other methods.
This code sample provides a general control panel to manage the process of audio recording:
While the AudioRecorder methods provide the tools to record audio, the component provides a number of properties that inform the process, allowing for a more informed experience that you can configure for your needs. The following code samples provide some means to control potentially useful properties.
The input property describes the device that will be capturing audio. This will start as the system default but can be changed to any available input device.
Not to be confused with the containerFormat property, the codec property defines the method the audio recording will be encoded and processed into. Codec, rather than filetype, usually controls how large or compressed a file will be. The codec property can be manipulated in the same way as the containerFormat property above.
The volume at which the audio will be recorded is controlled by the volume property in the form of an integer. The volume at which your device would normally record is defined as 1, so, for example, 0.5 will record at half volume. This code sample controls this property with a slider from 0 to 1, incrementing at every tenth.
The outputLocation property, set through the file dialog in the control panel code sample at the top of this page, defines the intended location to save the file. Once recording has started, the actualLocation property is set based on this, describing the path of the file that was actually made. In most cases, these two properties will be the same, but there are exceptions.