Class RecorderImpl

  • All Implemented Interfaces:
    Recorder

    public class RecorderImpl
    extends Object
    implements Recorder
    The call recording implementation. Provides the capability to start and stop call recording.
    Author:
    Dmitri Melnikov, Lubomir Marinov, Boris Grozev
    • Field Detail

      • SUPPORTED_FORMATS

        public static final String[] SUPPORTED_FORMATS
        The list of formats in which RecorderImpl instances support recording media.
    • Constructor Detail

      • RecorderImpl

        public RecorderImpl​(AudioMixerMediaDevice device)
        Constructs the RecorderImpl with the provided session.
        Parameters:
        device - device that can create a session that provides the output data source
    • Method Detail

      • addListener

        public void addListener​(Recorder.Listener listener)
        Adds a new Recorder.Listener to the list of listeners interested in notifications from this Recorder.
        Specified by:
        addListener in interface Recorder
        Parameters:
        listener - the new Recorder.Listener to be added to the list of listeners interested in notifications from this Recorder
        See Also:
        Recorder.addListener(Recorder.Listener)
      • removeListener

        public void removeListener​(Recorder.Listener listener)
        Removes a existing Recorder.Listener from the list of listeners interested in notifications from this Recorder.
        Specified by:
        removeListener in interface Recorder
        Parameters:
        listener - the existing Recorder.Listener to be removed from the list of listeners interested in notifications from this Recorder
        See Also:
        Recorder.removeListener(Recorder.Listener)
      • start

        public void start​(String format,
                          String filename)
                   throws IOException,
                          MediaException
        Starts the recording of the media associated with this Recorder (e.g. the media being sent and received in a Call) into a file with a specific name.
        Specified by:
        start in interface Recorder
        Parameters:
        format - the format into which the media associated with this Recorder is to be recorded into the specified file
        filename - the name of the file into which the media associated with this Recorder is to be recorded
        Throws:
        IOException - if anything goes wrong with the input and/or output performed by this Recorder
        MediaException - if anything else goes wrong while starting the recording of media performed by this Recorder
        See Also:
        Recorder.start(String, String)
      • stop

        public void stop()
        Stops the recording of the media associated with this Recorder (e.g. the media being sent and received in a Call) if it has been started and prepares this Recorder for garbage collection.
        Specified by:
        stop in interface Recorder
        See Also:
        Recorder.stop()
      • setMute

        public void setMute​(boolean mute)
        Put the recorder in mute state. It won't record the local input. This is used when the local call is muted and we don't won't to record the local input.
        Specified by:
        setMute in interface Recorder
        Parameters:
        mute - the new value of the mute property
      • getFilename

        public String getFilename()
        Returns the filename we are last started or stopped recording to, null if not started.
        Specified by:
        getFilename in interface Recorder
        Returns:
        the filename we are last started or stopped recording to, null if not started.
      • setEventHandler

        public void setEventHandler​(RecorderEventHandler eventHandler)
        Sets the RecorderEventHandler which this Recorder should notify when events related to recording (such as start/end of a recording) occur.
        Specified by:
        setEventHandler in interface Recorder
        Parameters:
        eventHandler - the RecorderEventHandler to set.
      • getSynchronizer

        public Synchronizer getSynchronizer()
        Gets the Synchronizer of this Recorder. This Recorder implementation does not use a Synchronizer.
        Specified by:
        getSynchronizer in interface Recorder
        Returns:
        the Synchronizer of this Recorder.
      • setSynchronizer

        public void setSynchronizer​(Synchronizer synchronizer)
        Sets the Synchronizer that this instance should use. This Recorder implementation does not use a Synchronizer.
        Specified by:
        setSynchronizer in interface Recorder
        Parameters:
        synchronizer - the Synchronizer to set.
      • getMediaStream

        public MediaStream getMediaStream()
        Gets the MediaStream associated with this Recorder.
        Specified by:
        getMediaStream in interface Recorder
        Returns:
        the MediaStream associated with this Recorder.