The Audio Recording action (screenshot below) starts or stops an audio recording. The recorded file is saved on the client device.
For example: If an Audio Recording Start action is associated with a button click, then the button click starts recording (via the device's mic) to the file specified in the action (see screenshot below); other recording parameters are also specified in the action's settings. If an Audio Recording Stop action is associated with a button click, then clicking this button stops any recording that was started from that page and is currently in progress.
Note: If an audio recording is in progress when a solution is suspended, then the recording is stopped.
|Note:||Audio should not be recorded at the same time as audio/video is being played back as this could result in problems with the playback state, particularly on iOS devices.|
Start audio recording
In the Audio Recording combo box (see screenshot) select Start.
For the Audio File setting, provide the relative path and name of the client-device file in which you want to save the recording. Do this by either entering the file path directly or selecting the file path via an XPath expression. The file path you provide will be resolved relative to the base directory you specify for that device type (see screenshot below). If the path contains folders that do not exist, you can check the option to automatically create missing sub-folders (see screenshot below). For information about audio file formats, see the section Audio/Video Formats.
•Android: Select the Android device-directory from the dropdown list. If you select Default, which is the default selection, the MobileTogether app's sandbox directory is selected. Note, however, that, unless the Android device is rooted, no other app (besides MobileTogether) will be able to access the MobileTogether sandbox directory. So, trying to open a file in the MobileTogether sandbox with another app could fail.
•Windows RT: Select the Windows Phone or Windows RT device folder from the dropdown list. If you select Default, which is the default selection, the MobileTogether app's sandbox directory is selected.
•iOS: MobileTogether creates two directories on the user's device: (i) a Backed-up directory for files that are backed up by the operating system and will be available at later times, for example, after a restore. This directory is intended for files that are important for the user and that should not be lost; (ii) a Non-backed-up directory for files that do not need to be backed up, or if faster buffering is needed for playback. Select Backed-up directory or Non-backed-up directory as required.
•Web browser: No selection is available. Relative paths are resolved within the context of the browser's sandbox.
Next, set up the parameters of the recording (see screenshot at the top of the page):
•Automatic File Extension: If selected, the file extension will be automatically added depending on the selected format and/or codec. You can use the XPath extension function mt-extract-file-extension to retrieve the extension of the last audio file that was recorded.
•Max File Size (in kB): The default value is unlimited. Note that the file size depends on the sampling rate and encoding bitrate.
•Max Recording Duration (in seconds): The default value is unlimited.
•Sampling Rate (in Hz): A higher sampling rate produces a more accurate digital representation of the audio signal. The downside of a higher sampling rate, however, is a larger file size. For your reference when selecting a sampling rate, CD-quality sampling is 44.1 kHz (44100 Hz). Note, however, that the sampling rate depends to a large extent on the encoder and audio coding standard being used. We recommend that you leave this setting blank so that the encoder will automatically use its own default setting. If you wish to specify a sampling rate, be sure to consult the related audio encoding standard or the encoder specifications.
•Encoding Bitrate (in kb/s): Essentially the level of compression. When an audio file is compressed, details are removed. Usually these details are frequencies outside the human frequency range (20 Hz to 20 kHz) or frequencies that are reproducible only by high-end speakers. The tradeoff is between file size and audio quality. A bitrate of 128 kbps is reasonable quality and typical for MP3s. Streaming audio is usually 256 kbps. CD-quality is 320 kbps. Typical bitrate values are: 96 kbps (standard quality on mobiles); 160 kbps (high quality on mobiles; standard quality on desktops); 320 kbps (extremely high quality on mobiles; high quality on desktops). We recommend that you leave this setting blank so that the encoder will automatically use its own default setting. If you wish to specify a bitrate, be sure to consult the related audio encoding standard or the encoder specifications.
•Android Settings: Select from the formats and audio recording encoders (codecs) available on Android devices. Default selects the default format/codec on the client device. For the AMR-NB and AMR-WB formats, use only the AMR-NB and AMR-WB codecs, respectively. The AAC format can be generated with the AAC-Low Complexity, High Efficiency-AAC, and Enhanced Low Delay-AAC codecs, but it is possible that not all of these codecs will be available or work on a given device. Unless you are aware of the effect of your choices for solution users, we recommend that you leave both settings at Default. See Audio/Video Formats for more information.
•Windows Settings: Select from the audio recording encoders (codecs) available on Windows devices. Default selects the default codec on the client device.
•iOS Settings:Select from the audio recording encoders (codecs) available on iOS devices. Default selects the default codec on the client device.
An audio recording will be stopped in the following situations:
•A Stop Audio Recording action is executed (see below). Such an action is executed when triggered by a client-side event, such as a button-click.
•The end user leaves the page or a page leave is executed.
•The solution is suspended.
Stop audio recording
Set the Audio Recording action to Stop (see screenshot below) to stop any audio recording that was started by an Audio Recording action on the same page and that is currently in progress.
|Note:||A recording is also stopped when a solution is suspended or when the user leaves the page on which the recording was started.|
The section Audio Recording provides an overview of the audio recording feature of MobileTogether. There, you will also find information about Audio Recording events.
MobileTogether extension functions
MobileTogether provides a range of XPath extension functions that have been specifically created for use in MobileTogether designs. Some functions can be particularly useful with specific actions. For example, mt-available-languages() returns the languages in which the solution is available and could, for example, be used with the Message Box action. If a function is especially relevant to this action, it is listed below. For a full list of extension functions and their descriptions, see the topic MobileTogether Extension Functions.