Skip to content

Add additional audio MIME types - #3387

Closed
ixgate-lpeters wants to merge 1 commit into
nextcloud:masterfrom
ixgate-lpeters:master
Closed

ixgate-lpeters wants to merge 1 commit into
nextcloud:masterfrom
ixgate-lpeters:master

Conversation

@ixgate-lpeters

Copy link
Copy Markdown

Summary

Adds audio/vnd.wave and audio/x-wav to the list of MIME types handled by the audio viewer.

Problem

WAV files are not playable in the Viewer when they are served with a MIME type other than audio/wav. In practice this affects real-world files quite often, because there are three MIME types in circulation for the same container format:

Open a .wav file in Files → inline player appears
  • Open a WAV attachment sent by Thunderbird (arrives as audio/vnd.wave) in Mail → inline player appears
  • Open a WAV declared as audio/x-wav → inline player appears
  • OCA.Viewer.mimetypes.filter(m => m.startsWith('audio/')) returns 11 entries
  • No regression for existing audio formats (MP3, FLAC, OGG)
  • Summary

    Adds audio/vnd.wave and audio/x-wav to the list of MIME types handled by the audio viewer.
    Problem

    WAV files are not playable in the Viewer when they are served with a MIME type other than audio/wav. In practice this affects real-world files quite often, because there are three MIME types in circulation for the same container format:
    MIME type Status Seen from
    audio/vnd.wave IANA-registered (RFC 2361) Thunderbird and other MUAs
    audio/wav de-facto standard most modern tooling — already supported
    audio/x-wav historic x- prefix older Windows tooling, legacy exports

    Only the middle one was registered, so the other two silently fall through.
    How I ran into this

    A WAV attachment in Nextcloud Mail showed no inline player, while an MP3 in the same position worked fine. Tracing it through:

    AttachmentMixin.js in Mail lets any audio/* attachment through, but then filters against OCA.Viewer.mimetypes
    OCA.Viewer.mimetypes is assembled in Viewer.js from the registered handlers
    The audio handler in src/models/audios.js only lists audio/wav
    The attachment in question was sent by Thunderbird as Content-Type: audio/vnd.wave → no match → no player
    

    So the file was perfectly playable, it just never reached the handler.
    Changes

    src/models/audios.js: added audio/vnd.wave and audio/x-wav, keeping the list alphabetically sorted
    

    Notes

    No mimesAliases needed here — all three types refer to the same RIFF/WAVE container, and determines decodability from the actual file contents rather than the declared MIME type. Adding them as regular mimes entries is sufficient.
    Test plan

    Open a .wav file in Files → inline player appears
    Open a WAV attachment sent by Thunderbird (arrives as audio/vnd.wave) in Mail → inline player appears
    Open a WAV declared as audio/x-wav → inline player appears
    OCA.Viewer.mimetypes.filter(m => m.startsWith('audio/')) returns 11 entries
    No regression for existing audio formats (MP3, FLAC, OGG)
    

    Added new audio MIME types 'audio/vnd.wave' and 'audio/x-wav' to the list.
    
    Signed-off-by: Lucas Peters <149142920+ixgate-lpeters@users.noreply.github.com>
    @skjnldsv

    Copy link
    Copy Markdown
    Member

    Closing in favour of nextcloud-libraries/nextcloud-viewer#45

    Thank you for the pr @ixgate-lpeters :)

    @skjnldsv skjnldsv closed this Sep 18, 2026
    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.

    2 participants