What is MIME type "audio/csound"?
A MIME type is a string that tells browsers and other tools how to handle a particular kind of file.
audio/csound is a MIME type for files that contain instructions for sound synthesis using the Csound language.It does not store actual audio recordings but rather code that directs a sound engine on how to generate audio in real time.
- Orchestra Files: Files like ORC define instruments and signal processing routines.
- Unified Files: Files like CSD combine both orchestra and score instructions into one file.
- Score Files: Files like SCO provide timing and note data that work with the orchestra.
For further reading on Csound and its applications, visit csound.com.
Associated file extensions
Usage Examples
HTTP Header
When serving content with this MIME type, set the Content-Type header:
Content-Type: audio/csound
HTML
In HTML, you can specify the MIME type in various elements:
<a href="file.dat" type="audio/csound">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/csound');
res.end('Content here');
}).listen(3000);
Associated file extensions
FAQs
What is the audio/csound MIME type used for?
This MIME type identifies files containing Csound code, which are text-based instructions for sound synthesis rather than actual recorded audio. Unlike binary formats like MP3, files served as audio/csound tell a synthesis engine how to generate sound in real-time.
Do web browsers natively play audio/csound files?
No, standard browsers like Chrome or Firefox do not have built-in decoders for Csound code. To play these files on a website, developers typically use WebAssembly versions of Csound or JavaScript libraries that interpret the code within the browser's audio context.
How do I configure Apache to serve Csound files?
You can add the MIME type definition to your .htaccess file or main configuration. Add the line AddType audio/csound .csd .orc .sco to ensure your server identifies these extensions correctly.
Why does my .csd file open as text code instead of playing?
Because Csound files are human-readable text (often XML-structured), browsers display the source code by default if no synthesis engine is running. To force a download instead of viewing the code, you can configure the server to send a Content-Disposition: attachment header.
How do I add audio/csound support to an Nginx server?
Edit your mime.types file or the types block inside your server configuration. Add the line audio/csound csd orc sco; and reload Nginx to apply the changes.
What is the difference between .csd, .orc, and .sco files?
While all three use audio/csound, they serve different structural roles. An .orc file defines the instruments (orchestra), a .sco file contains the notes (score), and a CSD file is a unified format that combines both into a single XML-like file.
Can I use text/plain instead of audio/csound?
Technically yes, because Csound files are plain text, and text/plain allows users to easily view the source code. However, using audio/csound is semantically correct and helps web applications distinguish between generic text notes and executable synthesis code.
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.