Giter Site home page Giter Site logo

aws-samples / chime-live-translation-transcription-polly Goto Github PK

View Code? Open in Web Editor NEW
12.0 10.0 3.0 2.58 MB

WebApp Proof of Concept - Live Translation + Polly

License: MIT No Attribution

JavaScript 4.06% HTML 0.63% TypeScript 91.73% CSS 3.58%
amplify api-gateway appsync chime cognito dynamodb lambda polly transcribe translate

chime-live-translation-transcription-polly's Issues

Value null at 'mediaSampleRateHertz' failed to satisfy constraint: Member must not be null

Expected behavior and actual behavior

ANSWER:

Expected:

  1. Sign in to the app
  2. Add a request ID in the "Request ID" filed and click "Join"
  3. Get prompted for browser access to mic and camera
  4. Click "Transcribe"
  5. Start speaking, and what is said is transcribed in the Transcription window

Actual behaviour on Firefox:

  1. Sign in to the app
  2. Add a request ID in the "Request ID" filed and click "Join"
  3. Get prompted for browser access to mic and camera
  4. Click "Transcribe"
  5. Error window pops up with the following message:

An error occurred while recording: {"Message":"1 validation error detected: Value null at 'mediaSampleRateHertz' failed to satisfy constraint: Member must not be null"}

Steps to reproduce the problem

ANSWER:

  1. In a terminal, clone the repo and navigate to the "chime-live-translation-transcription-polly" directory
  2. run "yarn"
  3. run "yarn start" to start up the local server
  4. In a Firefox browser, navigate to "localhost:3000"
  5. Sign in to the app
  6. Add a request ID in the "Request ID" filed and click "Join"
  7. Get prompted for browser access to mic and camera
  8. Click "Transcribe"

Specifications like the version of the project, operating system, or hardware

ANSWER:

Project version:
Used main branch of the project with latest commit ID 7c936d2

OS:
Mac [Ventura 13.3.1]

Browser details:
Firefox version 102.10.0esr

Observations

  • From what I can see the error is originating from the following line:

const command = new StartStreamTranscriptionCommand({ LanguageCode: language, MediaEncoding: 'pcm', MediaSampleRateHertz: sampleRate, AudioStream: audioStream, });

In Firefox, the value "sampleRate" passed for the MediaSampleRateHertz is null

  • seems like sampleRate is being set here:

sampleRate = mediaStream.getAudioTracks()[0].getSettings().sampleRate;

However, with Firefox, the object returned by "mediaStream.getAudioTracks()[0].getSettings()" does not include "sampleRate"

  • Overriding the sampleRate value and setting it to 44100 directly resolves the error, but then the app does not pick up any audio and no transcription is generated. After 15 seconds, the streaming session times out due to inactivity

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.