Multichannel Audio (Stereo)

Learn how to transcribe separate audio channels.

Introduction

Multi-channel audio has more than one “track”.

  1. Review the sample code below:
client = speech_v1p1beta1.SpeechClient()
language_code = "en-US"
sample_rate_hertz = 44100
encoding = enums.RecognitionConfig.AudioEncoding.MP3
config = {
        "language_code": language_code,
        "sample_rate_hertz": sample_rate_hertz,
        "encoding": encoding,
    }
audio = {"uri": storage_uri}
response = client.recognize(config, audio)
    for result in response.results:
        alternative = result.alternatives[0]
        print(u"Transcript: {}".format(alternative.transcript))

Get hands-on with 1200+ tech skills courses.