AudioRecordingConfiguration

Recording configuration.

class AudioRecordingConfiguration {
  const AudioRecordingConfiguration(
      {this.filePath,
      this.encode,
      this.sampleRate,
      this.fileRecordingType,
      this.quality,
      this.recordingChannel});

  @JsonKey(name: 'filePath')
  final String? filePath;

  @JsonKey(name: 'encode')
  final bool? encode;

  @JsonKey(name: 'sampleRate')
  final int? sampleRate;

  @JsonKey(name: 'fileRecordingType')
  final AudioFileRecordingType? fileRecordingType;

  @JsonKey(name: 'quality')
  final AudioRecordingQualityType? quality;

  @JsonKey(name: 'recordingChannel')
  final int? recordingChannel;

  factory AudioRecordingConfiguration.fromJson(Map<String, dynamic> json) =>
      _$AudioRecordingConfigurationFromJson(json);

  Map<String, dynamic> toJson() => _$AudioRecordingConfigurationToJson(this);
}

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 specified path 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, it is recommended to record in WAV format or use AAC files with quality set to audioRecordingQualityMedium or audioRecordingQualityHigh.
Recording sample rate (Hz).
  • 16000
  • 32000 (default)
  • 44100
  • 48000
fileRecordingType
Recording content. See AudioFileRecordingType.
quality
Recording quality. See audiorecordingqualitytype.
Note: This parameter applies only to AAC files.
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 will be stereo with duplicated mono data, not true stereo.
  • If the captured audio is stereo and recordingChannel is set to 1, the recorded audio will be mono with mixed stereo data.
In addition, the integration scheme may affect the final recorded audio channel. If you want to record true stereo, please contact technical support for assistance.
Number of audio channels to record. Supported values:
  • 1: (Default) Mono.
  • 2: Stereo.