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.PlaceholderFile
m_OutputFile
the 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 void
defineOptions()
Adds options to the internal list of options.protected String
doRecord()
Records the audio.protected abstract String
doRecordTo(adams.core.io.PlaceholderFile output)
Records the audio.Class
generates()
Returns the type of data that it outputs.protected abstract adams.core.io.PlaceholderFile
getDefaultOutputFile()
Returns the default output file.adams.core.io.PlaceholderFile
getOutputFile()
Returns the output file.String
getQuickInfo()
Returns a quick info about the actor, which will be displayed in the GUI.protected adams.flow.core.RunnableWithLogging
getRecordingWorker(DataLine.Info info, AudioFormat format, AudioFileFormat.Type type)
Returns worker runnable for recording audio.abstract String
outputFileTipText()
Returns the tip text for this property.void
setOutputFile(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:
defineOptions
in interfaceadams.core.option.OptionHandler
- Overrides:
defineOptions
in 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:
setOutputFile
in interfaceadams.core.io.FileWriter
- Parameters:
value
- the file
-
getOutputFile
public adams.core.io.PlaceholderFile getOutputFile()
Returns the output file.- Specified by:
getOutputFile
in interfaceadams.core.io.FileWriter
- Returns:
- the file
-
outputFileTipText
public abstract String outputFileTipText()
Returns the tip text for this property.- Specified by:
outputFileTipText
in 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:
getQuickInfo
in interfaceadams.core.QuickInfoSupporter
- Overrides:
getQuickInfo
in 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:
generates
in 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:
doRecord
in classAbstractAudioRecorder<String>
- Returns:
- the generated data
-
-