AudioFileRecordingConfig

Recording configuration.

public class AudioRecordingConfiguration
    {
        public AudioRecordingConfiguration()
        {
            filePath = "";
            encode = false;
            sampleRate = 32000;
            fileRecordingType = AUDIO_FILE_RECORDING_TYPE.AUDIO_FILE_RECORDING_MIXED;
            quality = AUDIO_RECORDING_QUALITY_TYPE.AUDIO_RECORDING_QUALITY_LOW;
            recordingChannel = 1;
        }

        public AudioRecordingConfiguration(string file_path, int sample_rate, AUDIO_RECORDING_QUALITY_TYPE quality_type, int channel)
        {
            this.filePath = file_path;
            this.encode = false;
            this.sampleRate = sample_rate;
            this.fileRecordingType = AUDIO_FILE_RECORDING_TYPE.AUDIO_FILE_RECORDING_MIXED;
            this.quality = quality_type;
            recordingChannel = channel;
        }

        public AudioRecordingConfiguration(string file_path, bool enc, int sample_rate,
                                        AUDIO_FILE_RECORDING_TYPE type, AUDIO_RECORDING_QUALITY_TYPE quality_type, int channel)
        {
            this.filePath = file_path;
            this.encode = enc;
            this.sampleRate = sample_rate;
            this.fileRecordingType = type;
            this.quality = quality_type;
            this.recordingChannel = channel;
        }

        public string filePath { set; get; }
        public bool encode { set; get; }
        public int sampleRate { set; get; }
        public AUDIO_FILE_RECORDING_TYPE fileRecordingType { set; get; }
        public AUDIO_RECORDING_QUALITY_TYPE quality { set; get; }
        public int recordingChannel { set; get; }
    };

Properties

filePath
The absolute path where the recording file is saved locally. Must include the file name and extension. For example: C:\music\audio.aac.
Note: Make sure the path you specify exists and is writable.
encode
Specifies whether to encode the audio data:
  • true: Encode the audio data using AAC.
  • false: (Default) Do not encode the audio data. Save the raw recorded audio data directly.
sampleRate
Note: If you set this parameter to 44100 or 48000, to ensure recording quality, we recommend recording a WAV file or an AAC file with quality set to AUDIO_RECORDING_QUALITY_MEDIUM or AUDIO_RECORDING_QUALITY_HIGH.
Recording sample rate (Hz).
  • 16000
  • 32000 (Default)
  • 44100
  • 48000
fileRecordingType
Recording content. See AUDIO_FILE_RECORDING_TYPE.
quality
Recording quality. See AUDIO_RECORDING_QUALITY_TYPE.
Note: This parameter applies to AAC files only.
recordingChannel
Note: The actual recorded audio channel depends on the captured audio channel:
  • If the captured audio is mono and recordingChannel is set to 2, the recorded audio is stereo created by duplicating the mono data, not true stereo.
  • If the captured audio is stereo and recordingChannel is set to 1, the recorded audio is mono created by mixing the stereo data.
In addition, the integration solution may affect the final recorded audio channel. If you want to record true stereo, please contact technical support for assistance.
Audio channel for recording. The following values are supported:
  • 1: (Default) Mono.
  • 2: Stereo.