I need to save each participant's audio track to S...
# ask-ai
h
I need to save each participant's audio track to S3. Is there a way to achieve this using start_participant_egress, with an audio_only option?
g
Yes, you can use the
startParticipantEgress
method to record each participant's audio track individually and save it to S3. According to the LiveKit documentation, you can specify the
audio_only
option when starting a Participant Egress. This allows you to record only the audio tracks of a participant. You will need to provide the participant's identity and configure the output to use S3 for storage. Would you like more details on how to implement this? Sources: - LiveKit documentation 👍 0 button 👎 1 button 💡 Hint: Mention @millions-hair-24956 in the thread for followups.
h
@millions-hair-24956 show how to add
audio_only
in egress.startParticipantEgress
@millions-hair-24956 show how to add
audio_only
in egress.startParticipantEgress (edited)
g
It seems likely that you can specify the
audio_only
option when using the
startParticipantEgress
method to ensure only audio tracks are recorded. However, the specific parameter
audio_only
is not explicitly mentioned in the provided data sources for
startParticipantEgress
. Instead, you can configure the egress to focus on audio by setting the appropriate options in the
ParticipantEgressOptions
. Here's a general example of how you might configure the
startParticipantEgress
method:
Copy code
const egressClient = new EgressClient('https://your-livekit-host', 'api-key', 'api-secret');

const output = {
  filepath: 'path/to/output.mp3',
  s3: {
    accessKey: 'your-access-key',
    secret: 'your-secret',
    region: 'your-region',
    bucket: 'your-bucket',
  },
};

const options = {
  encodingOptions: { audioOnly: true }, // This is a conceptual example
};

egressClient.startParticipantEgress('room-name', 'participant-identity', output, options)
  .then(info => console.log('Egress started:', info.egressId))
  .catch(error => console.error('Failed to start egress:', error));
Please let me know if you need more detailed guidance. Sources: - https://docs.livekit.io/server-sdk-js/interfaces/WebOptions.html - https://docs.livekit.io/home/egress/api/ 👍 1 button 👎 0 button 💡 Hint: Mention @millions-hair-24956 in the thread for followups.
h
thanks for
conceptual example
😄