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 booleancanBeCancelled()Indicates whether this operation can be cancelled.voidcancel()Cancels the operation asynchronously.StringgetName()AudioClipgetRequiredClip(AudioFileFormat format)Returns theAudioClipthat is actually required to perform the analysis.protected AudioClipgetRequiredClip(AudioFileFormat audioFileFormat, int filesizeFraction, long durationInMS)Utility method that should be used to overridegetRequiredClip(javax.sound.sampled.AudioFileFormat).booleanisCancelled()Indicates whether this operation has been cancelled.
-
-
-
Method Detail
-
getName
public String getName()
-
cancel
public void cancel()
Description copied from interface:OperationCancels the operation asynchronously.
-
canBeCancelled
public boolean canBeCancelled()
Description copied from interface:OperationIndicates whether this operation can be cancelled.- Specified by:
canBeCancelledin interfaceOperation- Returns:
- true or false
-
isCancelled
public boolean isCancelled()
Description copied from interface:OperationIndicates whether this operation has been cancelled.- Specified by:
isCancelledin interfaceOperation- Returns:
- true or false
-
getRequiredClip
public AudioClip getRequiredClip(AudioFileFormat format)
Returns theAudioClipthat 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
-
-