Skip to content

Conversation

@huuthieu
Copy link

@huuthieu huuthieu commented Dec 2, 2025

This commit adds speaker diarization capability to the AWS Transcribe STT plugin:

  1. Enable diarization capability in STTCapabilities when show_speaker_label is set to True
  2. Extract speaker_id from AWS Transcribe response items and populate it in SpeechData

When show_speaker_label=True is passed to the STT constructor, the plugin will now:

  • Advertise diarization capability to the LiveKit framework
  • Extract speaker labels (e.g., "spk_0", "spk_1") from AWS Transcribe responses
  • Include speaker_id in the SpeechData returned to the application

Usage example:

stt = aws.STT(
    language="en-US",
    show_speaker_label=True,
)

async for event in stt_stream:
    if event.type == stt.SpeechEventType.FINAL_TRANSCRIPT:
        speaker_id = event.alternatives[0].speaker_id
        text = event.alternatives[0].text
        print(f"Speaker {speaker_id}: {text}")

This commit adds speaker diarization capability to the AWS Transcribe STT plugin:

1. Enable diarization capability in STTCapabilities when show_speaker_label is set to True
2. Extract speaker_id from AWS Transcribe response items and populate it in SpeechData

When show_speaker_label=True is passed to the STT constructor, the plugin will now:
- Advertise diarization capability to the LiveKit framework
- Extract speaker labels (e.g., "spk_0", "spk_1") from AWS Transcribe responses
- Include speaker_id in the SpeechData returned to the application

Usage example:
```python
stt = aws.STT(
    language="en-US",
    show_speaker_label=True,
)

async for event in stt_stream:
    if event.type == stt.SpeechEventType.FINAL_TRANSCRIPT:
        speaker_id = event.alternatives[0].speaker_id
        text = event.alternatives[0].text
        print(f"Speaker {speaker_id}: {text}")
```
@CLAassistant
Copy link

CLAassistant commented Dec 2, 2025

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants