appium-xcuitest-driver
Version:
Appium driver for iOS using XCUITest for backend
50 lines • 3 kB
TypeScript
export class AudioRecorder {
constructor(input: any, log: any, audioPath: any, opts?: {});
input: any;
log: any;
audioPath: any;
opts: {};
mainProcess: SubProcess | null;
start(timeoutSeconds: any): Promise<void>;
isRecording(): boolean;
interrupt(force?: boolean): Promise<boolean>;
finish(): Promise<any>;
cleanup(): Promise<void>;
}
declare namespace _default {
let _audioRecorder: AudioRecorder | null;
/**
* Records the given hardware audio input and saves it into an `.mp4` file.
*
* **To use this command, the `audio_record` security feature must be enabled _and_ [FFMpeg](https://ffmpeg.org/) must be installed on the Appium server.**
*
* @param {string|number} audioInput - The name of the corresponding audio input device to use for the capture. The full list of capture devices could be shown by executing `ffmpeg -f avfoundation -list_devices true -i ""`
* @param {string|number} timeLimit - The maximum recording time, in seconds.
* @param {string} audioCodec - The name of the audio codec.
* @param {string} audioBitrate - The bitrate of the resulting audio stream.
* @param {string|number} audioChannels - The count of audio channels in the resulting stream. Setting it to `1` will create a single channel (mono) audio stream.
* @param {string|number} audioRate - The sampling rate of the resulting audio stream (in Hz).
* @param {boolean} forceRestart - Whether to restart audio capture process forcefully when `mobile: startRecordingAudio` is called (`true`) or ignore the call until the current audio recording is completed (`false`).
* @group Real Device Only
* @this {XCUITestDriver}
* @returns {Promise<void>}
* @privateRemarks Using string literals for the default parameters makes better documentation.
*/
function startAudioRecording(this: import("../driver").XCUITestDriver, audioInput: string | number, timeLimit?: string | number, audioCodec?: string, audioBitrate?: string, audioChannels?: string | number, audioRate?: string | number, forceRestart?: boolean): Promise<void>;
/**
* Stop recording of the audio input. If no audio recording process is running then
* the endpoint will try to get the recently recorded file.
* If no previously recorded file is found and no active audio recording
* processes are running then the method returns an empty string.
*
* @returns {Promise<string>} Base64-encoded content of the recorded media file or an
* empty string if no audio recording has been started before.
* @throws {Error} If there was an error while getting the recorded file.
* @this {XCUITestDriver}
*/
function stopAudioRecording(this: import("../driver").XCUITestDriver): Promise<string>;
}
export default _default;
export type XCUITestDriver = import("../driver").XCUITestDriver;
import { SubProcess } from 'teen_process';
//# sourceMappingURL=record-audio.d.ts.map