Main
Intro
Download
Copyright


Manuals
Users'
Programmers'
Developers'
FAQ

Appendix
Team, Friends & Links




Programmers' Manual

by Holger Crysandt


Structure

The structure of the encoder is quite simple: Is a black box with one input for the audio signal and one output for the MPEG-7 description of the audio content. The MPEG-7 description is available as XML Document (DOM-Tree). The Document can be converted into a String using a XLST Processor.

Include the library in another application

The easiest way to create an MPEG-7 Descption is to use the static encode() function of the MP7DocumentBuilder class:

...
import javax.sound.sampled.AudioInputStream;
import de.crysandt.audio.mpeg7audio.*
...

AudioInputStream ais = ...
Config config = ...

...
Document mpeg7 = MP7DocumentBuilder.encode(ais, config);
...

Create an AudioInputStream using the static methods of AudioSystem.getAudioInputStream(...). The audio source can be a File or InputStream. The audio signal can be stored in any audio format as long as your JRE is capable to play the audio content.

The configuration config contains the information which descriptors should be extracted. The configuration can either be parsed from a XML file:


import java.io.Reader;
import de.crysandt.audio.mpeg7audio.*
...
Reader reader = ...
Config config  = ConfigXML.parse(reader)
...

or defined manually:


Config config = new ConfigDefault();

/* Turn all descriptors off */
config.enableAll(false);

config.setValue("Resizer", "HopSize", 10);        // set HopSize to 10ms
config.setValue("AudioWaveform", "enable", true); // Extract the AudioWaveform

/* set more parameters */
...

Please observe that the names of modules and parameters are case sensitive! A list of all modules and their parameters is given in the Users' manual.

To learn more about how to create a MPEG-7 description take a look at the main(...) function of the class MP7DocumentBuilder.

Last updated: 2009-06-13SourceForge.net Logo