Index: src/test/java/org/apache/tika/parser/audio/MidiParserTest.java
===================================================================
--- src/test/java/org/apache/tika/parser/audio/MidiParserTest.java	(revision 0)
+++ src/test/java/org/apache/tika/parser/audio/MidiParserTest.java	(revision 0)
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.tika.parser.audio;
+
+import java.io.InputStream;
+
+import junit.framework.TestCase;
+
+import org.apache.tika.metadata.Metadata;
+import org.apache.tika.parser.Parser;
+import org.xml.sax.helpers.DefaultHandler;
+
+public class MidiParserTest extends TestCase {
+
+    private final Parser parser = new MidiParser();
+
+    public void testMID() throws Exception {
+        Metadata metadata = new Metadata();
+        metadata.set(Metadata.CONTENT_TYPE, "audio/midi");
+        InputStream stream = getClass().getResourceAsStream(
+                "/test-documents/testMID.mid");
+
+        parser.parse(stream, new DefaultHandler(), metadata);
+
+        assertEquals("2", metadata.get("tracks"));
+        assertEquals("0", metadata.get("patches"));
+        assertEquals("PRQ", metadata.get("divisionType"));
+
+    }
+}
Index: src/test/java/org/apache/tika/parser/audio/AudioParserTest.java
===================================================================
--- src/test/java/org/apache/tika/parser/audio/AudioParserTest.java	(revision 0)
+++ src/test/java/org/apache/tika/parser/audio/AudioParserTest.java	(revision 0)
@@ -0,0 +1,76 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.tika.parser.audio;
+
+import java.io.InputStream;
+
+import junit.framework.TestCase;
+
+import org.apache.tika.metadata.Metadata;
+import org.apache.tika.parser.Parser;
+import org.xml.sax.helpers.DefaultHandler;
+
+public class AudioParserTest extends TestCase {
+
+    private final Parser parser = new AudioParser();
+
+    public void testWAV() throws Exception {
+        Metadata metadata = new Metadata();
+        metadata.set(Metadata.CONTENT_TYPE, "audio/x-wav");
+        InputStream stream = getClass().getResourceAsStream(
+                "/test-documents/testWAV.wav");
+
+        parser.parse(stream, new DefaultHandler(), metadata);
+
+        assertEquals("44100", metadata.get("samplerate"));
+        assertEquals("2", metadata.get("channels"));
+        assertEquals("16", metadata.get("bits"));
+        assertEquals("PCM_SIGNED", metadata.get("encoding"));
+
+    }
+
+    public void testAIFF() throws Exception {
+        Metadata metadata = new Metadata();
+        metadata.set(Metadata.CONTENT_TYPE, "audio/x-aiff");
+        InputStream stream = getClass().getResourceAsStream(
+                "/test-documents/testAIFF.aif");
+
+        parser.parse(stream, new DefaultHandler(), metadata);
+
+        assertEquals("44100", metadata.get("samplerate"));
+        assertEquals("2", metadata.get("channels"));
+        assertEquals("16", metadata.get("bits"));
+        assertEquals("PCM_SIGNED", metadata.get("encoding"));
+
+    }
+
+    public void testAU() throws Exception {
+        Metadata metadata = new Metadata();
+        metadata.set(Metadata.CONTENT_TYPE, "audio/basic");
+        InputStream stream = getClass().getResourceAsStream(
+                "/test-documents/testAU.au");
+
+        parser.parse(stream, new DefaultHandler(), metadata);
+
+        assertEquals("44100", metadata.get("samplerate"));
+        assertEquals("2", metadata.get("channels"));
+        assertEquals("16", metadata.get("bits"));
+        assertEquals("PCM_SIGNED", metadata.get("encoding"));
+
+    }
+
+}
Index: src/test/resources/test-documents/testMID.mid
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: src/test/resources/test-documents/testMID.mid
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: src/test/resources/test-documents/testWAV.wav
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: src/test/resources/test-documents/testWAV.wav
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: src/test/resources/test-documents/testMP3.mp3
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: src/test/resources/test-documents/testAIFF.aif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: src/test/resources/test-documents/testAIFF.aif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: src/test/resources/test-documents/testAU.au
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: src/test/resources/test-documents/testAU.au
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: src/main/java/org/apache/tika/parser/audio/MidiParser.java
===================================================================
--- src/main/java/org/apache/tika/parser/audio/MidiParser.java	(revision 0)
+++ src/main/java/org/apache/tika/parser/audio/MidiParser.java	(revision 0)
@@ -0,0 +1,78 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.tika.parser.audio;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.HashMap;
+
+import javax.sound.midi.InvalidMidiDataException;
+import javax.sound.midi.MidiSystem;
+import javax.sound.midi.Sequence;
+
+import org.apache.tika.exception.TikaException;
+import org.apache.tika.metadata.Metadata;
+import org.apache.tika.parser.Parser;
+import org.apache.tika.sax.XHTMLContentHandler;
+import org.xml.sax.ContentHandler;
+import org.xml.sax.SAXException;
+
+public class MidiParser implements Parser {
+
+    public void parse(InputStream stream, ContentHandler handler,
+            Metadata metadata) throws IOException, SAXException, TikaException {
+        parse(stream, metadata);
+        XHTMLContentHandler xhtml = new XHTMLContentHandler(handler, metadata);
+        xhtml.startDocument();
+        xhtml.endDocument();
+    }
+
+    private static HashMap<Float, String> divisionTypes = new HashMap<Float, String>();
+
+    static {
+        divisionTypes.put(Sequence.PPQ, "PRQ");
+        divisionTypes.put(Sequence.SMPTE_24, "SMPTE_24");
+        divisionTypes.put(Sequence.SMPTE_25, "SMPTE_25");
+        divisionTypes.put(Sequence.SMPTE_30, "SMPTE_30");
+        divisionTypes.put(Sequence.SMPTE_30DROP, "SMPTE_30DROP");
+    }
+
+    public void parse(InputStream stream, Metadata metadata)
+            throws IOException, TikaException {
+        String type = metadata.get(Metadata.CONTENT_TYPE);
+        if (type != null) {
+
+            try {
+
+                Sequence sequence = MidiSystem.getSequence(stream);
+
+                metadata.set("tracks", Integer
+                        .toString(sequence.getTracks().length));
+
+                metadata.set("patches", Integer.toString(sequence
+                        .getPatchList().length));
+
+                metadata.set("divisionType", divisionTypes.get(sequence
+                        .getDivisionType()));
+
+            } catch (InvalidMidiDataException e) {
+                // cannot parse format
+            }
+
+        }
+    }
+}
Index: src/main/java/org/apache/tika/parser/audio/AudioParser.java
===================================================================
--- src/main/java/org/apache/tika/parser/audio/AudioParser.java	(revision 0)
+++ src/main/java/org/apache/tika/parser/audio/AudioParser.java	(revision 0)
@@ -0,0 +1,85 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.tika.parser.audio;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Map.Entry;
+
+import javax.sound.sampled.AudioFileFormat;
+import javax.sound.sampled.AudioFormat;
+import javax.sound.sampled.AudioSystem;
+import javax.sound.sampled.UnsupportedAudioFileException;
+
+import org.apache.tika.exception.TikaException;
+import org.apache.tika.metadata.Metadata;
+import org.apache.tika.parser.Parser;
+import org.apache.tika.sax.XHTMLContentHandler;
+import org.xml.sax.ContentHandler;
+import org.xml.sax.SAXException;
+
+public class AudioParser implements Parser {
+
+    public void parse(InputStream stream, ContentHandler handler,
+            Metadata metadata) throws IOException, SAXException, TikaException {
+        parse(stream, metadata);
+        XHTMLContentHandler xhtml = new XHTMLContentHandler(handler, metadata);
+        xhtml.startDocument();
+        xhtml.endDocument();
+    }
+
+    public void parse(InputStream stream, Metadata metadata)
+            throws IOException, TikaException {
+        String type = metadata.get(Metadata.CONTENT_TYPE);
+        if (type != null) {
+            try {
+
+                AudioFileFormat fileFormat = AudioSystem
+                        .getAudioFileFormat(stream);
+
+                AudioFormat format = fileFormat.getFormat();
+
+                metadata.set("samplerate", Integer.toString((int) format
+                        .getSampleRate()));
+                metadata
+                        .set("channels", Integer.toString(format.getChannels()));
+                metadata.set("bits", Integer.toString(format
+                        .getSampleSizeInBits()));
+                metadata.set("encoding", format.getEncoding().toString());
+
+                // Javadoc suggests that some of the following properties might
+                // be available, but I had no success in finding any:
+
+                // "duration" Long playback duration of the file in microseconds
+                // "author" String name of the author of this file
+                // "title" String title of this file
+                // "copyright" String copyright message
+                // "date" Date date of the recording or release
+                // "comment" String an arbitrary text
+
+                for (Entry<String, Object> entry : format.properties()
+                        .entrySet()) {
+                    metadata.set(entry.getKey(), entry.getValue().toString());
+                }
+
+            } catch (UnsupportedAudioFileException e) {
+                // cannot parse, unknown format
+            }
+
+        }
+    }
+}
Index: src/main/resources/tika-config.xml
===================================================================
--- src/main/resources/tika-config.xml	(revision 695251)
+++ src/main/resources/tika-config.xml	(working copy)
@@ -125,6 +125,19 @@
         <parser name="parse-mp3" class="org.apache.tika.parser.mp3.Mp3Parser">
                 <mime>audio/mpeg</mime>
         </parser>
+
+        <parser name="parse-midi" class="org.apache.tika.parser.audio.MidiParser">
+                <mime>application/x-midi</mime>
+                <mime>audio/midi</mime>
+        </parser>
+
+        <parser name="parse-audio" class="org.apache.tika.parser.audio.AudioParser">
+                <mime>audio/basic</mime>
+                <mime>audio/x-wav</mime>
+                <mime>audio/x-aiff</mime>
+        </parser>
+
+
     </parsers>
 
 </properties>
\ No newline at end of file
