FAudioRecordingConfiguration
Recording configurations.
USTRUCT(BlueprintType) struct FAudioRecordingConfiguration { GENERATED_BODY() public: UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Agora|AudioRecordingConfiguration") FString filePath = ""; UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Agora|AudioRecordingConfiguration") bool encode = false; UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Agora|AudioRecordingConfiguration") int sampleRate = 0; UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Agora|AudioRecordingConfiguration") EAUDIO_FILE_RECORDING_TYPE fileRecordingType = EAUDIO_FILE_RECORDING_TYPE::AUDIO_FILE_RECORDING_MIXED; UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Agora|AudioRecordingConfiguration") EAUDIO_RECORDING_QUALITY_TYPE quality = EAUDIO_RECORDING_QUALITY_TYPE::AUDIO_RECORDING_QUALITY_LOW; UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Agora|AudioRecordingConfiguration") int recordingChannel = 0; FAudioRecordingConfiguration(){} FAudioRecordingConfiguration(const agora::rtc::AudioRecordingConfiguration & AgoraData){ filePath = UTF8_TO_TCHAR(AgoraData.filePath); encode = AgoraData.encode; sampleRate = AgoraData.sampleRate; fileRecordingType = static_cast<EAUDIO_FILE_RECORDING_TYPE>(AgoraData.fileRecordingType); quality = static_cast<EAUDIO_RECORDING_QUALITY_TYPE>(AgoraData.quality); recordingChannel = AgoraData.recordingChannel; } agora::rtc::AudioRecordingConfiguration CreateAgoraData() const { agora::rtc::AudioRecordingConfiguration AgoraData; SET_UABT_FSTRING_TO_CONST_CHAR___MEMALLOC(AgoraData.filePath, this->filePath) AgoraData.encode = encode; AgoraData.sampleRate = sampleRate; AgoraData.fileRecordingType = static_cast<agora::rtc::AUDIO_FILE_RECORDING_TYPE>(fileRecordingType); AgoraData.quality = static_cast<agora::rtc::AUDIO_RECORDING_QUALITY_TYPE>(quality); AgoraData.recordingChannel = recordingChannel; return AgoraData; } void FreeAgoraData(agora::rtc::AudioRecordingConfiguration& AgoraData) const { SET_UABT_FSTRING_TO_CONST_CHAR___MEMFREE(AgoraData.filePath) } };
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 AUDIO_RECORDING_QUALITY_MEDIUM or AUDIO_RECORDING_QUALITY_HIGH for better recording quality.
- fileRecordingType
-
The recording content. See EAUDIO_FILE_RECORDING_TYPE.
- quality
-
Recording quality. See EAUDIO_RECORDING_QUALITY_TYPE.
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.