ademidun / atila-client-web-app

Client web app for atila.ca
https://atila.ca
0 stars 0 forks source link

Add voice recording to user profile #549

Closed grace0925 closed 2 years ago

grace0925 commented 2 years ago

Closes #548 Related to #429

Overview

More on AudioRecord

This component uses the MediaRecorder to record audio in mp3 format. The sound blob is stored on firebase as an mp3 file under the specified filePath (mentor-profile-audio for the mentor profile audio messages). Each audio file has a name of random string of length 8.

image

On button press, the browser asks the user for permission to use the microphone for audio recording. On confirmation, voice recording begins until the confirm button is pressed.

image image

After the audio message is saved, the AudioPlay component is rendered. The delete button will reset the recorder and remove the audio file url from postgres db.

image

TODOs/Known issues

ademidun commented 2 years ago

Excellent work @grace0925 thanks for the detailed PR description. Some feedback:

  1. Make sure you create new files as .tsx files, we now support typescript, so let's use it.

  2. Moving forward, use reaction functional components instead of class components and hooks. See this SO answer and this conversation.

    1. Protip: Use this extension and you can make components with rfce. I saw you did that for `Audi
  3. deleteAudioRecording should also delete the file in Firebase