Git Product home page Git Product logo

amazon-transcribe-streaming-python-websockets's Introduction

Amazon Transcribe Streaming in Python with Websockets

This example project demonstrates how to use Amazon Transcribe in real-time with Python and Websockets. It contains no dependencies on Boto3.

Requirements

  • Python 3.10
  • websockets (pip install websockets)
  • AWS credentials

How to Use

The example file is named example.py. It will send audio in 100ms 'chunks' per payload, serialized/marshalled into the AWS EventStream AudioEvent format. The file that gets streamed is example_call_2_channel.wav. The JSON response from Amazon Transcribe is parsed and the partial result transcripts are printed to the terminal.

Before running the example, make sure that you have your AWS AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, and AWS_DEFAULT_REGION (region is optional, and will default to us-east-1). You can fill them into the variables defined in example.py, or set environment variables with the same names. Please note: If you are using temporary credentials, for example, from STS, you will also need to set the AWS_SESSION_TOKEN.

If you are swapping out the audio file for something else, please configure at the # Sound settings variables and update the media_encoding, number_of_channels,

To run the example, navigate via the cli to the folder, and type python3 example.py

Security

See CONTRIBUTING for more information.

License

This library is licensed under the MIT-0 License. See the LICENSE file.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.