Class FixedDuration

  • All Implemented Interfaces:
    adams.core.Destroyable, adams.core.GlobalInfoSupporter,, 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.
    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
        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
        defineOptions in class AbstractFileBasedAudioRecorder
      • outputFileTipText

        public String outputFileTipText()
        Returns the tip text for this property.
        Specified by:
        outputFileTipText in interface
        Specified by:
        outputFileTipText in class AbstractFileBasedAudioRecorder
        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.
        value - the duration in sec
      • getDuration

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

        public String durationTipText()
        Returns the tip text for this property.
        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.
        info - the line info
        format - the format to record in
        the runnable
      • doRecordTo

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