Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add audio recording attachment #1979

Closed
wants to merge 10 commits into from

Conversation

MartinCupela
Copy link
Contributor

@MartinCupela MartinCupela commented Mar 24, 2023

🎯 Goal

Add an attachment widget to display audio recording.

🛠 Implementation details

There are 2 types of new audio recording widgets:

  1. AudioRecordingPlayer - displayed in the message attachment
  2. QuotedAudioRecording - displayed in the quoted message attachment

AudioRecordingPlayer

Uses a new WaveProgressBar component to display the audio amplitudes. There are always 40 amplitude bars in each WaveProgressBar, meanwhile the list of incoming amplitudes in the response from the API (attachment.waveList) is variable. Therefore the WaveProgressBar component implements simple algorithms to downsample and upsample the original input arrays.

The player widget also allows user to change the playback speed (rate).

🎨 UI Changes

Styles: GetStream/stream-chat-css#224

Audio recording player

audio-recording-player

Audio recording quoted reply

audio-recording-quoted

Audio recording missing wave list

audio-recording-empty-wave-list

Audio recording missing title fallback

audio-recording-fallback-title

audio-recording-quoted-fallback-title

Audio recording missing duration fallback to file size

audio-recording-player-file-size-fallback

audio-recording-quoted-file-size-fallback

Audio recording in progress

audio-recording-player-in-progress

Audio recording stopped repro

audio-recording-player-stopped-repro

Audio recording response payload

audio-recording-response-payload

Closes: #2036

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Handle 'voiceRecording' attachment type as audio
2 participants