Transcribe a conversation using Google Speech

35 Views Asked by At

I'm trying to perform voice-to-text transcription using Google Speech. I've managed to capture the audio from the microphone and send it to the Google Speech API in real time. I'm trying to do the same with the speaker's audio, but I'm not sure if the best way would be to separate these two audio streams. What would be the best way to transcribe, in real-time, a conversation between two people in a communication tool like Google Meeting, for example?

Below is my client using PyAudio:

audio = pyaudio.PyAudio()
stream = audio.open(
    format=FORMAT,
    channels=CHANNELS,
    rate=RATE,
    input=True,
    frames_per_buffer=CHUNK,
)

while True:
    data = stream.read(CHUNK)
    await sio.emit("binaryAudioData", data)
    await asyncio.sleep(0)
await sio.wait()
0

There are 0 best solutions below