Package com.tagtraum.audiokern
Class AudioAnalyzer
- java.lang.Object
-
- com.tagtraum.audiokern.AudioAnalyzer
-
- All Implemented Interfaces:
Operation
public abstract class AudioAnalyzer extends Object implements Operation
Audio analyzer.- Author:
- Hendrik Schreiber
-
-
Constructor Summary
Constructors Constructor Description AudioAnalyzer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canBeCancelled()
Indicates whether this operation can be cancelled.void
cancel()
Cancels the operation asynchronously.String
getName()
AudioClip
getRequiredClip(AudioFileFormat format)
Returns theAudioClip
that is actually required to perform the analysis.protected AudioClip
getRequiredClip(AudioFileFormat audioFileFormat, int filesizeFraction, long durationInMS)
Utility method that should be used to overridegetRequiredClip(javax.sound.sampled.AudioFileFormat)
.boolean
isCancelled()
Indicates whether this operation has been cancelled.
-
-
-
Method Detail
-
getName
public String getName()
-
cancel
public void cancel()
Description copied from interface:Operation
Cancels the operation asynchronously.
-
canBeCancelled
public boolean canBeCancelled()
Description copied from interface:Operation
Indicates whether this operation can be cancelled.- Specified by:
canBeCancelled
in interfaceOperation
- Returns:
- true or false
-
isCancelled
public boolean isCancelled()
Description copied from interface:Operation
Indicates whether this operation has been cancelled.- Specified by:
isCancelled
in interfaceOperation
- Returns:
- true or false
-
getRequiredClip
public AudioClip getRequiredClip(AudioFileFormat format)
Returns theAudioClip
that is actually required to perform the analysis.- Parameters:
format
- file format of the original, potentially compressed audio file- Returns:
- clip actually required for analysis or null, if the whole file is needed or the clip cannot be determined. The default implementation always returns null.
-
getRequiredClip
protected AudioClip getRequiredClip(AudioFileFormat audioFileFormat, int filesizeFraction, long durationInMS)
Utility method that should be used to overridegetRequiredClip(javax.sound.sampled.AudioFileFormat)
.- Parameters:
filesizeFraction
- reciprocal value of the fraction we want to jump to (start point), if less than or equal to one, the startoffset of the resulting audioclip will be 0audioFileFormat
- file format of the original, potentially compressed audio filedurationInMS
- duration of the desired clip in ms (length)- Returns:
- clip actually required for analysis or null, if the duration of the file was indeterminable
-
-