What is MIME type "audio/m"?

A MIME type is a string that tells browsers and other tools how to handle a particular kind of file.

audio/m is a MIME type used for files that contain musical instructions rather than traditional sound recordings. It is closely related to the MIDI standard.

MIDI files store note data, tempo, and instrument information. This allows devices and software to generate music dynamically.

Files with the extensions MIDI and MID typically use this MIME type.

Learn more about media types at the IANA Media Types registry.

Associated file extensions

Usage Examples

HTTP Header

When serving content with this MIME type, set the Content-Type header:


    Content-Type: audio/m    
  

HTML

In HTML, you can specify the MIME type in various elements:


    <a href="file.dat" type="audio/m">Download file</a>    
  

Server-side (Node.js)

Setting the Content-Type header in Node.js:


    const http = require('http');    
    
    http.createServer((req, res) => {    
      res.setHeader('Content-Type', 'audio/m');    
      res.end('Content here');    
    }).listen(3000);    
  

Associated file extensions

FAQs

What type of content uses the audio/m MIME type?

The audio/m MIME type is associated with MIDI files, typically ending in .mid or .midi. These files contain digital musical instructions, such as notes and tempo, rather than actual recorded audio waveforms.

Is audio/m the standard MIME type for MIDI files?

No, the official IANA standard is audio/midi. However, audio/m is sometimes used in specific server configurations or legacy applications. For maximum compatibility, developers often support both or stick to the standard audio/midi.

How do I configure Apache to serve audio/m files?

You can define the MIME type in your .htaccess file or the main server config. Add the line AddType audio/m .mid .midi to ensure the server sends the correct Content-Type header to the client.

Why won't my web browser play audio/m files natively?

Modern browsers (like Chrome, Firefox, and Safari) have removed native support for MIDI playback (QuickTime plugins, etc.) due to security and standardization reasons. To play these files on a webpage, you generally need a JavaScript library or you must convert them to audio/mpeg.

What is the difference between audio/m and audio/wav?

audio/m (MIDI) stores performance data (which note to play and when), resulting in tiny file sizes. audio/wav stores the actual recorded sound wave, resulting in much larger files but consistent audio quality across all devices.

How can I fix a 'Resource interpreted as Document' error for .mid files?

This error occurs if the server sends the file with a generic type or creates a download instead of a stream. Ensure your server sends the Content-Type: audio/m (or audio/midi) header so the browser or player understands it is a media file.

Can I use audio/m for Nginx server configuration?

Yes, you can add it to the mime.types file or your server block. Use the directive types { audio/m mid midi; } to map the extensions to this MIME type.

General FAQ

What is a MIME type?

A MIME (Multipurpose Internet Mail Extensions) type is a standard that indicates the nature and format of a document, file, or assortment of bytes. MIME types are defined and standardized in IETF's RFC 6838.

MIME types are important because they help browsers and servers understand how to process a file. When a browser receives a file from a server, it uses the MIME type to determine how to display or handle the content, whether it's an image to display, a PDF to open in a viewer, or a video to play.

MIME types consist of a type and a subtype, separated by a slash (e.g., text/html, image/jpeg, application/pdf). Some MIME types also include optional parameters.

How do I find the MIME type for a file?

You can check the file extension or use a file identification tool such as file --mime-type on the command line. Many programming languages also provide libraries to detect MIME types.

Why are multiple MIME types listed for one extension?

Different applications and historical conventions may use alternative MIME identifiers for the same kind of file. Showing them all helps ensure compatibility across systems.