comirva.audio.extraction
Class AttributeExtractor

java.lang.Object
  extended by comirva.audio.extraction.AttributeExtractor
Direct Known Subclasses:
AudioFeatureExtractor

public abstract class AttributeExtractor
extends Object

Title: Attribute Extractor

Description:

This interface defines a very general attribute extractor. It separates the process of extracting an attribute from the representation of an attribute as an object.

See Also:
Attribute

Constructor Summary
AttributeExtractor()
           
 
Method Summary
abstract  Attribute calculate(File input)
          This method encapsulates the attribute extraction process.
abstract  AttributeExtractor copy()
          This method returns a copy of an AttributeExtractor.
abstract  int getAttributeType()
          Returns the type of the attribute that the class implementing this interface will return as the result of its extraction process.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AttributeExtractor

public AttributeExtractor()
Method Detail

copy

public abstract AttributeExtractor copy()
This method returns a copy of an AttributeExtractor. This is useful to use multiple extractors in parallel or distributed environments as AttributeExtractors can be stateful.

Returns:

calculate

public abstract Attribute calculate(File input)
                             throws IOException,
                                    IllegalArgumentException,
                                    UnsupportedAudioFileException
This method encapsulates the attribute extraction process. The input parameter is open, because of the very general design of AttributeExtractor and Attribute. A concrete class implementing this interface will however expect the input to be of a certain type and will raise a IllegalArgumentException, if the passed argument is not of the expected type.

Parameters:
input - Object an object representing the input data to extract the feature out of
Returns:
Feature a feature extracted from the input data
Throws:
IOException - failures due to io operations are signaled by IOExceptions
IllegalArgumentException - raised if method contract is violated, especially if the open input type is not of the expected type
UnsupportedAudioFileException

getAttributeType

public abstract int getAttributeType()
Returns the type of the attribute that the class implementing this interface will return as the result of its extraction process. By definition this is the hash code of the attribute's class name.

Returns:
int an integer uniquely identifying the returned Attribute