Skip to main content

Record conversations with Cloud Recording

This guide explains how to configure Agora Cloud Recording to work with conversational AI agents and avoid audio scene conflicts.

Audio scene conflict

When you use conversational AI agents and Cloud Recording in the same channel, an audio scene conflict can cause a brief audio interruption when recording starts. This happens because the agent's audio scene reverts to default mode when a user joins the channel during Cloud Recording.

To avoid this issue, set the agent's audio_scenario parameter to "chorus" to ensure stable audio processing with Cloud Recording.

Configure the agent

Add or modify the audio_scenario field in the agent startup parameters:


_7
{
_7
"properties": {
_7
"parameters": {
_7
"audio_scenario": "chorus"
_7
}
_7
}
_7
}

Complete configuration example

The following example shows a complete agent launch request with the optimized configuration:


_48
{
_48
"name": "TestConvoAgent",
_48
"properties": {
_48
"channel": "{{AccessChannel}}",
_48
"token": "{{token}}",
_48
"agent_rtc_uid": "0",
_48
"remote_rtc_uids": [
_48
"*"
_48
],
_48
"idle_timeout": 30,
_48
"advanced_features": {
_48
"enable_bhvs": true
_48
},
_48
"llm": {
_48
"url": "https://api.openai.com/v1/chat/completions",
_48
"api_key": "<your_llm_api_key>",
_48
"system_messages": [
_48
{
_48
"role": "system",
_48
"content": "You are a helpful chatbot."
_48
}
_48
],
_48
"greeting_message": "Hello, how can I help you?",
_48
"failure_message": "Sorry, I don't know how to answer this question.",
_48
"max_history": 10,
_48
"params": {
_48
"model": "gpt-4o-mini"
_48
}
_48
},
_48
"tts": {
_48
"vendor": "microsoft",
_48
"params": {
_48
"key": "<your_tts_api_key>",
_48
"region": "eastus",
_48
"voice_name": "en-US-AndrewMultilingualNeural"
_48
}
_48
},
_48
"turn_detection": {
_48
"silence_duration_ms": 640
_48
},
_48
"parameters": {
_48
"enable_dump": true,
_48
"enable_error_message": true,
_48
"audio_scenario": "chorus",
_48
"enable_delay": true
_48
}
_48
}
_48
}

Start Cloud Recording

After starting the agent, start Cloud Recording by calling the Start Cloud Recording API.

The following example shows a complete Cloud Recording start request body:


_26
{
_26
"cname":"{{AccessChannel}}",
_26
"uid":"{{RecordingUID}}",
_26
"clientRequest":{
_26
"token":"{{token}}",
_26
"recordingConfig":{
_26
"maxIdleTime":120,
_26
"streamTypes":0,
_26
"audioProfile":1,
_26
"channelType":1
_26
},
_26
"recordingFileConfig": {
_26
"avFileType": [
_26
"hls",
_26
"mp4"
_26
]
_26
},
_26
"storageConfig":{
_26
"vendor":{{Vendor}},
_26
"region":{{Region}},
_26
"bucket":"{{Bucket}}",
_26
"accessKey":"{{AccessKey}}",
_26
"secretKey":"{{SecretKey}}"
_26
}
_26
}
_26
}