AudioRecordingConfiguration
Recording configurations.
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); }
Attributes
- filePath
- The absolute path (including the filename extensions) of the recording file. For example:
C:\music\audio.aac
.Attention:Ensure that the directory for the log files exists and is writable.
- encode
- Whether to encode the audio data:
true
: Encode audio data in AAC.false
: (Default) Do not encode audio data, but save the recorded audio data directly.
- sampleRate
- Recording sample rate (Hz).
- 16000
- (Default) 32000
- 44100
- 48000
Attention:If you set this parameter to 44100 or 48000, Agora recommends recording WAV files, or AAC files with quality set as audioRecordingQualityMedium or audioRecordingQualityHigh for better recording quality.
- fileRecordingType
-
The recording content. See AudioFileRecordingType.
- quality
-
Recording quality. See audiorecordingqualitytype.
Attention:This parameter applies to AAC files only.
- recordingChannel
- The audio channel of recording: The parameter supports the following values:
- 1: (Default) Mono.
- 2: Stereo.
Note:The actual recorded audio channel is related to the audio channel that you capture.- If the captured audio is mono and recordingChannel is
2
, the recorded audio is the dual-channel data that is copied from mono data, not stereo. - If the captured audio is dual channel and recordingChannel is
1
, the recorded audio is the mono data that is mixed by dual-channel data.