aws-samples / aws-sdk-js-notes-app

A simple note taking application using modular AWS SDK for JavaScript (v3)
Other
81 stars 30 forks source link

TranscribeStreaming continues even after microphone is turned off #12

Closed trivikr closed 3 years ago

trivikr commented 3 years ago

Describe the bug

TranscribeStreaming continues even after microphone is turned off.

Steps to reproduce

Start frontend of notes-app, turn microphone icon on and off and continue talking.

Observed behavior

React state is update with transcripts.

Expected behavior

Transcription should stop when microphone icon is turned off.

Screenshots

Screen recording https://user-images.githubusercontent.com/16024985/106816188-df3de580-6629-11eb-9383-5e5300aa3c68.mov

Additional context

Noticed while debugging https://github.com/aws-samples/aws-sdk-js-notes-app/issues/11

trivikr commented 3 years ago

This happens because micStream.stop() is not called in the following code: https://github.com/aws-samples/aws-sdk-js-notes-app/blob/58086ba8758e37c4b21d448dc45fc17ccac9723d/packages/frontend/src/content/RecordAudioButton.tsx#L22-L27