<@U07FRRZH2GN> How can i record conversation audio
# ask-ai
f
@icy-policeman-64898 How can i record conversation audio
t
Thanks for reaching out, Abhishek. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
I'm glad you're interested in recording conversation audio with LiveKit! There are a few ways you can do this, depending on what suits your needs best: • Server-Side Recording with Egress: This method automatically captures all audio and video in a room and safely stores it in cloud storage like S3, GCS, or Azure. • Client-Side Track Recording: If you prefer, you can use SDKs such as Rust, Node.js, or Android to record individual audio tracks right on the client side. • Agent Recording with RecorderIO: Perfect for AI agent applications, this records both input and output audio streams in OGG format. • Text Transcripts: You can also capture real-time transcripts or save your conversation history as JSON files. If you share a bit more about your specific use case—whether it’s a client app, server-side setup, or an AI agent—I’d be happy to guide you through the best option for you!
f
@icy-policeman-64898 Give me the steps to store this in egress and tell me if there is any cost associated with this
t
To help you store audio recordings in LiveKit Egress, here’s a simple step-by-step guide: 1. Choose Egress Type: You can select Room Composite if you want to record the entire room's audio, or Track Egress if you prefer to capture individual audio tracks. 2. Configure Storage: Set up your cloud storage (like S3, GCP, or Azure) with the necessary credentials. Here’s an example configuration to get you started:
Copy code
storage:
  s3:
    access_key: AWS_ACCESS_KEY_ID
    secret: AWS_SECRET_ACCESS_KEY
    region: AWS_DEFAULT_REGION
    bucket: your-audio-bucket
1. Set Audio-Only Recording: Use the API to specify that you want audio-only recording. Here’s a handy example:
Copy code
req = api.RoomCompositeEgressRequest(
    room_name="my-room",
    audio_only=True,
    segment_outputs=[api.SegmentedFileOutput(
        filename_prefix="audio-recording",
        gcp=api.GCPUpload(
            credentials=file_contents,
            bucket="my-audio-bucket",
        ),
    )],
)
1. Start Recording: Simply use the LiveKit API to kick off the egress process.
Copy code
lkapi = api.LiveKitAPI()
res = await lkapi.egress.start_room_composite_egress(req)
Costs to Keep in Mind: • Transcoding Minutes: $0.005 per minute for audio-only recordings after your included minutes (Starter: 60, Pro: 600, Enterprise: 8,000). • Track Egress: $0.001 per minute for raw single stream audio exports. • Storage Costs: These are separate and depend on your cloud provider. Track Egress tends to be the most budget-friendly if you’re looking for simple audio recordings. If you have any questions or need a hand with anything else, just let me know—I’m here to help! Sources: Recording and export | LiveKit Docs | egress/recording_agent.py | livekit-api/livekit/api/egress_service.py | LiveKit Pricing | pkg/config/service.go