Fix audio codec handling and enhance voice recorder functionality#286
Open
dozro wants to merge 11 commits intoSableClient:devfrom
Open
Fix audio codec handling and enhance voice recorder functionality#286dozro wants to merge 11 commits intoSableClient:devfrom
dozro wants to merge 11 commits intoSableClient:devfrom
Conversation
…waveform sample documentation
…ct file extensions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
This pull request adds robust support for multiple audio codecs in the voice recording feature, ensuring that audio messages are recorded, stored, and transmitted with the appropriate codec and file extension based on browser support. It introduces a utility to detect supported codecs, updates the recording and file creation process to use the detected codec, and ensures that codec information is correctly propagated through the application. Additionally, the audio message content structure is enhanced for better compatibility with Matrix clients.
Audio codec detection and handling
supportedCodec.ts) to detect supported audio codecs in the browser and map codecs to the correct file extensions. This utility is now used throughout the voice recording flow to select the optimal codec and ensure files are named with the correct extension.useVoiceRecordernow always uses the detected supported codec for both theMediaRecorderand file creation, falling back gracefully if none are found.Propagating codec information
VoiceRecorderStopPayloadand related props now include theaudioCodecfield, and this information is passed up from the recorder to parent components, ensuring the codec type is available wherever the audio message is handled.File naming and extension improvements
.ogg,.webm,.mp3, etc.) rather than defaulting to.oggor.webm, improving compatibility and clarity for users and clients.Matrix message content enhancements
getAudioMsgContent) is updated to include more accurate metadata, improved fallback text, and additional Matrix extensible event keys for better compatibility with Element and other Matrix clients.UI and minor improvements
These changes together make the voice recording feature more robust, standards-compliant, and user-friendly across different browsers and Matrix clients.
Fixes #
Still not fixed: compatibiltiy with iOS webkit, macOS webkit works fine...
Type of change
Checklist: