Skip to content
Discussion options

You must be logged in to vote

Does this Python script help you out?

import requests
import json

def get_speaker_wise_transcript(response):
    speaker_transcripts = {}

    for channel in response['results']['channels']:
        for word in channel['alternatives'][0]['words']:
            speaker_id = word['speaker']

            if speaker_id not in speaker_transcripts:
                speaker_transcripts[speaker_id] = word['word']
            else:
                speaker_transcripts[speaker_id] += ' ' + word['word']

    return speaker_transcripts

# Replace this with your Deepgram API key
API_KEY = "your-deepgram-api-key"

# Replace this with the path to your audio file
AUDIO_FILE_PATH = "path-to-your-audio-file.…

Replies: 3 comments 3 replies

Comment options

You must be logged in to vote
3 replies
@SandraRodgers
Comment options

@rilhia
Comment options

@SandraRodgers
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by jpvajda
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants