feat: add conversation recorder extension #1950
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Conversation Recorder Extension
This PR adds the
conversation_recorderextension, which allows for recording both user and agent audio during a session, mixing them into a single WAV file, and saving them to various storage backends.Changes Overview
The PR introduces a new extension located at
ai_agents/agents/ten_packages/extension/conversation_recorder/. Below is a breakdown of the included files:extension.pyon_user_joined/on_user_leftevents, and coordinates audio mixing and storage.audio_mixer.pystorage.pyREADME.mdmanifest.jsonrequirements.txtnumpy,scipy,google-cloud-storage, andboto3.addon.py/__init__.pyproperty.jsonKey Features
SIGTERM,SIGINT) andatexithooks to ensure recordings are correctly flushed and closed even if the agent process is interrupted.on_user_joined.How to use
Integrate the extension into your graph by:
pcm_frameoutputs from audio sources (e.g.,streamid_adapterandv2v) to theconversation_recordernode.on_user_joinedandon_user_leftcommands from your RTC extension to the recorder.storage_typeand relevant credentials in the graph properties.