Package adams.flow.source.audiorecorder
Class OnDemand
- 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
-
- adams.flow.source.audiorecorder.OnDemand
-
- 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
public class OnDemand extends AbstractFileBasedAudioRecorder
Records a WAV file from when the user starts recording to when the user ends it.- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected adams.flow.core.RunnableWithLoggingm_Monitorthe monitor thread.protected adams.flow.core.RunnableWithLoggingm_Recordingthe recording worker thread.-
Fields inherited from class adams.flow.source.audiorecorder.AbstractFileBasedAudioRecorder
m_OutputFile
-
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 OnDemand()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Stringcheck()Hook method for performing checks before attempting to generate the setups.protected StringdoRecordTo(adams.core.io.PlaceholderFile output)Records the audio.protected adams.core.io.PlaceholderFilegetDefaultOutputFile()Returns the default output file.protected adams.flow.core.RunnableWithLogginggetRecordingWorker(DataLine.Info info, AudioFormat format)Returns worker runnable for recording audio.StringglobalInfo()Returns a string describing the object.StringoutputFileTipText()Returns the tip text for this property.booleanrequiresFlowContext()Returns whether flow context is actually required.voidstopExecution()Stops the execution.-
Methods inherited from class adams.flow.source.audiorecorder.AbstractFileBasedAudioRecorder
defineOptions, doRecord, generates, getOutputFile, getQuickInfo, getRecordingWorker, setOutputFile
-
Methods inherited from class adams.flow.source.audiorecorder.AbstractAudioRecorder
bigEndianTipText, bitsTipText, channelsTipText, getAudioFormat, getBigEndian, getBits, getChannels, getDataLineInfo, getFlowContext, getSampleRate, getSigned, isStopped, record, sampleRateTipText, setBigEndian, setBits, setChannels, setFlowContext, setSampleRate, setSigned, signedTipText
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, initialize, loggingLevelTipText, newOptionManager, reset, setLoggingLevel, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
-
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Specified by:
globalInfoin interfaceadams.core.GlobalInfoSupporter- Specified by:
globalInfoin classadams.core.option.AbstractOptionHandler- Returns:
- a description suitable for displaying in the gui
-
getDefaultOutputFile
protected adams.core.io.PlaceholderFile getDefaultOutputFile()
Returns the default output file.- Specified by:
getDefaultOutputFilein classAbstractFileBasedAudioRecorder- Returns:
- the default
-
outputFileTipText
public String outputFileTipText()
Returns the tip text for this property.- Specified by:
outputFileTipTextin interfaceadams.core.io.FileWriter- Specified by:
outputFileTipTextin classAbstractFileBasedAudioRecorder- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
requiresFlowContext
public boolean requiresFlowContext()
Returns whether flow context is actually required.- Specified by:
requiresFlowContextin classAbstractAudioRecorder<String>- Returns:
- true if required
-
getRecordingWorker
protected adams.flow.core.RunnableWithLogging getRecordingWorker(DataLine.Info info, AudioFormat format)
Returns worker runnable for recording audio.- Parameters:
info- the line infoformat- the format to record in- Returns:
- the runnable
-
check
protected String check()
Hook method for performing checks before attempting to generate the setups.- Overrides:
checkin classAbstractAudioRecorder<String>- Returns:
- null if successful, otherwise error message
-
doRecordTo
protected String doRecordTo(adams.core.io.PlaceholderFile output)
Records the audio.- Specified by:
doRecordToin classAbstractFileBasedAudioRecorder- Parameters:
output- the file to record to- Returns:
- null if successful, otherwise error message
-
stopExecution
public void stopExecution()
Stops the execution.- Specified by:
stopExecutionin interfaceadams.core.Stoppable- Overrides:
stopExecutionin classAbstractAudioRecorder<String>
-
-