Class 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 Detail

      • m_Recording

        protected adams.flow.core.RunnableWithLogging m_Recording
        the recording worker thread.
      • m_Monitor

        protected adams.flow.core.RunnableWithLogging m_Monitor
        the monitor thread.
    • Constructor Detail

      • OnDemand

        public OnDemand()
    • Method Detail

      • globalInfo

        public String globalInfo()
        Returns a string describing the object.
        Specified by:
        globalInfo in interface adams.core.GlobalInfoSupporter
        Specified by:
        globalInfo in class adams.core.option.AbstractOptionHandler
        Returns:
        a description suitable for displaying in the gui
      • outputFileTipText

        public String outputFileTipText()
        Returns the tip text for this property.
        Specified by:
        outputFileTipText in interface adams.core.io.FileWriter
        Specified by:
        outputFileTipText in class AbstractFileBasedAudioRecorder
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • getRecordingWorker

        protected adams.flow.core.RunnableWithLogging getRecordingWorker​(DataLine.Info info,
                                                                         AudioFormat format)
        Returns worker runnable for recording audio.
        Parameters:
        info - the line info
        format - the format to record in
        Returns:
        the runnable
      • check

        protected String check()
        Hook method for performing checks before attempting to generate the setups.
        Overrides:
        check in class AbstractAudioRecorder<String>
        Returns:
        null if successful, otherwise error message
      • doRecordTo

        protected String doRecordTo​(adams.core.io.PlaceholderFile output)
        Records the audio.
        Specified by:
        doRecordTo in class AbstractFileBasedAudioRecorder
        Parameters:
        output - the file to record to
        Returns:
        null if successful, otherwise error message