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

      • m_OutputFile

        protected adams.core.io.PlaceholderFile m_OutputFile
        the output file.
    • Constructor Detail

      • AbstractFileBasedAudioRecorder

        public AbstractFileBasedAudioRecorder()
    • Method Detail

      • 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 AbstractAudioRecorder<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 interface adams.core.io.FileWriter
        Parameters:
        value - the file
      • getOutputFile

        public adams.core.io.PlaceholderFile getOutputFile()
        Returns the output file.
        Specified by:
        getOutputFile in interface adams.core.io.FileWriter
        Returns:
        the file
      • outputFileTipText

        public abstract String outputFileTipText()
        Returns the tip text for this property.
        Specified by:
        outputFileTipText in interface adams.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 interface adams.core.QuickInfoSupporter
        Overrides:
        getQuickInfo in class AbstractAudioRecorder<String>
        Returns:
        null if no info available, otherwise short string
      • 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 info
        format - the format to record in
        type - 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