Start audio recording (FR)
Perfecto Command
mobile:audio.recording:start
Purpose
Starts recording the audio output from the device and creates a WAV file. The file is saved in the media storage server. A URL to the file location is returned in the response to the command and, if supplied, in the Result variable supplied as a parameter.
To hear the audio when using Start Audio in the Perfecto Automation IDE, you need to use the Open Device command and the parameter "Audio Recording" should be set to TRUE.
Important: The audio file is not available until after the Stop audio recording command is completed.
Restriction: For devices connected to the Enhanced Video Solution (Distributor = MacCam), it will not be possible to record audio during a phone call. Although the start audio recording command will succeed, the resulting recording will be "blank" and will contain no audio. This is due to a limitation where the audio is played through an internal device speaker and cannot be captured by the system.
Parameters
None
Return Value
URL of the audio file that will be created.
Exceptions
None
Examples
Copy
Java sample
//declare the Map for script parameters
Map<String, Object> params = new HashMap<>();
String audUrl = (String) driver.executeScript("mobile:audio.recording:start", params);
Copy
JavaScript sample
var params = {};
String audUrl = browser.executeScript('mobile:audio.recording:start', params);
Copy
C# sample
//declare the Map for script parameters
Dictionary<String, Object> pars = new Dictionary<String, Object>();
String audUrl = (String) driver.ExecuteScript("mobile:audio.recording:start", pars);