fix(audio): map webm and mp4 container mime types to audio extensions#1030
Open
mrmorgan-i wants to merge 1 commit into
Open
fix(audio): map webm and mp4 container mime types to audio extensions#1030mrmorgan-i wants to merge 1 commit into
mrmorgan-i wants to merge 1 commit into
Conversation
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
finforeports browserMediaRecorderoutput asvideo/webm, since WebM is a container format. That isn't inGeneratesAudioFilename's match list, so it falls through todefault => 'mp3'and the file gets uploaded asaudio.mp3with WebM bytes inside it. OpenAI fails to parse it with:Same thing happens with
video/mp4, which is what Safari'sMediaRecorderproduces.This adds the container types to the existing match list. The
default => 'mp3'fallback is unchanged, along with the three tests covering it.Related to #981. That issue covers the
audio/x-wavalias, and #1001 handles it at theMedialayer, which makes sense for aliases that are for sure audio.video/webmis different because it's a truthful mime type, and normalizing it inMediawould break genuine video input such as Gemini's. So this only touches the audio filename helper, and the two changes shouldn't conflict.