awslabs / amazon-transcribe-streaming-sdk

The Amazon Transcribe Streaming SDK is an async Python SDK for converting audio into text via Amazon Transcribe.
Apache License 2.0
153 stars 41 forks source link

Example simple_mic.py causing error "HTTP/2 could not be negotiated: HttpVersion.Http1_1" #104

Closed flick1533 closed 3 months ago

flick1533 commented 3 months ago

Hello,

After installing both amazon-transcribe, and sounddevice, when executing the code here, it throws an exception.

The error message is "amazon_transcribe.exceptions.HTTPException: HTTP/2 could not be negotiated: HttpVersion.Http1_1

With this in mind, I attempted to enforce http2 and return the protocol being used with the script below:

import httpx

url = "https://transcribestreaming.us-east-1.amazonaws.com/"
with httpx.Client(http2=True, verify=False) as client:
    response = client.get(url)
    print(f"HTTP Version used: {response.http_version}")

I expect to return "HTTP Version used: HTTP/2", however, I am retrieving HTTP/1.1. What is needed to enforce http2 for the simple_mic.py?

boto3 version: 
Version: 1.34.158

botocore version:
Version: 1.34.158

python version:
Python 3.10.11