You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Audio(format=...) generates non-canonical MIME types for mp3 and m4a #4627
When an Audio object is created from in-memory data using the format parameter, the generated MIME type is constructed as audio/<format>. This produces non-canonical MIME types for some formats such as mp3 and m4a.
For example, Audio(format="mp3") generates audio/mp3, while Audio(path="sample.mp3") resolves to audio/mpeg. Similarly, Audio(format="m4a") generates audio/m4a, while Audio(path="sample.m4a") resolves to audio/mp4.
I expected both construction paths to produce the same canonical MIME type.
Current output on main
audio/mp3
audio/mpeg
audio/m4a
audio/mp4
Expected output
audio/mpeg
audio/mpeg
audio/mp4
audio/mp4
Additional context
Python's mimetypes module also resolves these extensions to the canonical MIME types:
The Audio(path=...) constructor also uses these canonical MIME types, whereas the Audio(format=...) constructor appears to generate MIME types by simply concatenating audio/ with the supplied format.
Activity
fix : canonical mime type mapping from formats to remove inconsistency …