feat: add audio recording attachment #1979
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🎯 Goal
Add an attachment widget to display audio recording.
🛠 Implementation details
There are 2 types of new audio recording widgets:
AudioRecordingPlayer
- displayed in the message attachmentQuotedAudioRecording
- displayed in the quoted message attachmentAudioRecordingPlayer
Uses a new
WaveProgressBar
component to display the audio amplitudes. There are always 40 amplitude bars in eachWaveProgressBar
, meanwhile the list of incoming amplitudes in the response from the API (attachment.waveList
) is variable. Therefore theWaveProgressBar
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 quoted reply
Audio recording missing wave list
Audio recording missing title fallback
Audio recording missing duration fallback to file size
Audio recording in progress
Audio recording stopped repro
Audio recording response payload
Closes: #2036