Package adams.flow.source.audiorecorder
Class AbstractFileBasedAudioRecorder
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.flow.source.audiorecorder.AbstractAudioRecorder<String>
-
- adams.flow.source.audiorecorder.AbstractFileBasedAudioRecorder
-
- All Implemented Interfaces:
adams.core.Destroyable,adams.core.GlobalInfoSupporter,adams.core.io.FileWriter,adams.core.logging.LoggingLevelHandler,adams.core.logging.LoggingSupporter,adams.core.option.OptionHandler,adams.core.QuickInfoSupporter,adams.core.SizeOfHandler,adams.core.Stoppable,adams.core.StoppableWithFeedback,adams.flow.core.FlowContextHandler,Serializable
- Direct Known Subclasses:
FixedDuration,OnDemand
public abstract class AbstractFileBasedAudioRecorder extends AbstractAudioRecorder<String> implements adams.core.io.FileWriter
Ancestor for file-based audio recorders.- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected adams.core.io.PlaceholderFilem_OutputFilethe output file.-
Fields inherited from class adams.flow.source.audiorecorder.AbstractAudioRecorder
m_BigEndian, m_Bits, m_Channels, m_FlowContext, m_SampleRate, m_Signed, m_Stopped
-
-
Constructor Summary
Constructors Constructor Description AbstractFileBasedAudioRecorder()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voiddefineOptions()Adds options to the internal list of options.protected StringdoRecord()Records the audio.protected abstract StringdoRecordTo(adams.core.io.PlaceholderFile output)Records the audio.Classgenerates()Returns the type of data that it outputs.protected abstract adams.core.io.PlaceholderFilegetDefaultOutputFile()Returns the default output file.adams.core.io.PlaceholderFilegetOutputFile()Returns the output file.StringgetQuickInfo()Returns a quick info about the actor, which will be displayed in the GUI.protected adams.flow.core.RunnableWithLogginggetRecordingWorker(DataLine.Info info, AudioFormat format, AudioFileFormat.Type type)Returns worker runnable for recording audio.abstract StringoutputFileTipText()Returns the tip text for this property.voidsetOutputFile(adams.core.io.PlaceholderFile value)Sets the output file.-
Methods inherited from class adams.flow.source.audiorecorder.AbstractAudioRecorder
bigEndianTipText, bitsTipText, channelsTipText, check, getAudioFormat, getBigEndian, getBits, getChannels, getDataLineInfo, getFlowContext, getSampleRate, getSigned, isStopped, record, requiresFlowContext, sampleRateTipText, setBigEndian, setBits, setChannels, setFlowContext, setSampleRate, setSigned, signedTipText, stopExecution
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, globalInfo, initialize, loggingLevelTipText, newOptionManager, reset, setLoggingLevel, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
-
-
-
Method Detail
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptionsin interfaceadams.core.option.OptionHandler- Overrides:
defineOptionsin classAbstractAudioRecorder<String>
-
getDefaultOutputFile
protected abstract adams.core.io.PlaceholderFile getDefaultOutputFile()
Returns the default output file.- Returns:
- the default
-
setOutputFile
public void setOutputFile(adams.core.io.PlaceholderFile value)
Sets the output file.- Specified by:
setOutputFilein interfaceadams.core.io.FileWriter- Parameters:
value- the file
-
getOutputFile
public adams.core.io.PlaceholderFile getOutputFile()
Returns the output file.- Specified by:
getOutputFilein interfaceadams.core.io.FileWriter- Returns:
- the file
-
outputFileTipText
public abstract String outputFileTipText()
Returns the tip text for this property.- Specified by:
outputFileTipTextin interfaceadams.core.io.FileWriter- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
getQuickInfo
public String getQuickInfo()
Returns a quick info about the actor, which will be displayed in the GUI.- Specified by:
getQuickInfoin interfaceadams.core.QuickInfoSupporter- Overrides:
getQuickInfoin classAbstractAudioRecorder<String>- Returns:
- null if no info available, otherwise short string
-
generates
public Class generates()
Returns the type of data that it outputs.- Specified by:
generatesin classAbstractAudioRecorder<String>- Returns:
- the data type
-
getRecordingWorker
protected adams.flow.core.RunnableWithLogging getRecordingWorker(DataLine.Info info, AudioFormat format, AudioFileFormat.Type type)
Returns worker runnable for recording audio.- Parameters:
info- the line infoformat- the format to record intype- the file type- Returns:
- the runnable
-
doRecordTo
protected abstract String doRecordTo(adams.core.io.PlaceholderFile output)
Records the audio.- Parameters:
output- the file to record to- Returns:
- null if successful, otherwise error message
-
doRecord
protected String doRecord()
Records the audio.- Specified by:
doRecordin classAbstractAudioRecorder<String>- Returns:
- the generated data
-
-