Class FixedDuration

  • 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 FixedDuration
    extends AbstractFileBasedAudioRecorder
    Records a WAV file of fixed duration.
    Author:
    FracPete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Detail

      • m_Duration

        protected int m_Duration
        the duration to record.
      • 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

      • FixedDuration

        public FixedDuration()
    • 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
      • defineOptions

        public void defineOptions()
        Adds options to the internal list of options.
        Specified by:
        defineOptions in interface adams.core.option.OptionHandler
        Overrides:
        defineOptions in class AbstractFileBasedAudioRecorder
      • 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.
      • setDuration

        public void setDuration​(int value)
        Sets the duration of the recording.
        Parameters:
        value - the duration in sec
      • getDuration

        public int getDuration()
        Returns the duration of the recording.
        Returns:
        the duration in sec
      • durationTipText

        public String durationTipText()
        Returns the tip text for this property.
        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
      • 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