Package ipsk.audio

Interface AudioController

  • All Known Implementing Classes:
    J2AudioController

    public interface AudioController
    Deprecated.
    Please use AudioController2 instead.
    Manages audio recording and playback. This interface allows easy recording of playback and recording auf audio. It supports simultanous recording/playback of more than one line. Implementations should try to synchronize this lines. Audio lines and channels are sometimes confused: A line is a way for an audio stream. The audio stream can have one or more channels, determined by the audio format setting. After the number of lines (using setNumLines(int)) and the audio format (using setAudioFormat(AudioFormat)) are set, you must configure ( configure()) the controller. If the controller is not able to find matching audio lines it will throw an exception. Before starting playback or recording (or capturing) you have to open the controller.
    Summary of features:
    • looks for matching audio mixers and lines
    • configures and opens the lines
    • handles synchronized starting and stopping

    A typical scenario for a session:

    1. Set audio format for the session.
    2. Optionally set the mixer and/or number of lines to use.
    3. Configure the session.
    4. Open the session.
    5. Prepare recording.
    6. Start recording.
    7. Stop recording.
    8. Prepare playback.
    9. Optionally set start/stop position.
    10. Start playback.
    11. Pause playback.
    12. Start playback.
    13. Stop playback or the playback finishes at the end of file(s)
    14. Repeat several times from Nr. 5.
    15. Close session.
    Version:
    $Id: AudioController.java,v 1.15 2011/04/07 19:49:01 klausj Exp $
    Author:
    Klaus Jänsch, klausj@phonetik.uni-muenchen.de
    • Method Detail

      • setSourceMixerName

        void setSourceMixerName​(java.lang.String mixerName)
        Deprecated.
        Use the source mixer (playback) with the given name.
        Parameters:
        mixerName - the name of the source mixer
      • setSourceMixer

        void setSourceMixer​(javax.sound.sampled.Mixer.Info mixerInfo)
        Deprecated.
        Use the source mixer (playback) described by mixerInfo.
        Parameters:
        mixerInfo - the info (name) of the mixer
      • getSourceMixerInfo

        javax.sound.sampled.Mixer.Info getSourceMixerInfo()
        Deprecated.
        Get current used source mixer (playback) info.
        Returns:
        mixerInfo the info of the source mixer
      • setTargetMixerName

        void setTargetMixerName​(java.lang.String mixerName)
        Deprecated.
        Use the target mixer (recording) with the given name.
        Parameters:
        mixerName - the name of the target mixer
      • setTargetMixer

        void setTargetMixer​(javax.sound.sampled.Mixer.Info mixerInfo)
        Deprecated.
        Use the target mixer (recording) described by mixerInfo.
        Parameters:
        mixerInfo - the info of the target mixer
      • getTargetMixerInfo

        javax.sound.sampled.Mixer.Info getTargetMixerInfo()
        Deprecated.
        Get current used target mixer (recording) info.
        Returns:
        mixerInfo the info (name) of the target mixer
      • setMode

        void setMode​(long modeBits)
        Deprecated.
      • getMode

        long getMode()
        Deprecated.
      • setNumLines

        void setNumLines​(int numLines)
        Deprecated.
        Use numLines lines. For each line a recording file will be created.
        Parameters:
        numLines - number of lines to use
      • getNumLines

        int getNumLines()
        Deprecated.
        Get number of lines.
        Returns:
        number of lines to use
      • setAudioFormat

        void setAudioFormat​(javax.sound.sampled.AudioFormat audioFormat)
        Deprecated.
        Use audio format audioFormat..
        Parameters:
        audioFormat - audio format
      • getAudioFormat

        javax.sound.sampled.AudioFormat getAudioFormat()
        Deprecated.
        Get audio format.
        Returns:
        audio format
      • getPlaybackAudioFormat

        javax.sound.sampled.AudioFormat getPlaybackAudioFormat()
        Deprecated.
        Get audio format for playback. The controller sets the audio format according to the set playback files. So it can differ from the chosen foprmat.
        Returns:
        audio format
      • setPlaybackFiles

        void setPlaybackFiles​(java.io.File[] playbackFiles)
        Deprecated.
        Sets playback files to use.

        the size of the array must equal the number of lines opened.

        Parameters:
        playbackFiles - the file array to play
      • getPlaybackFiles

        java.io.File[] getPlaybackFiles()
        Deprecated.
        Gets playback files.

        the size of the array is equal the number of lines opened.

        Returns:
        the file array of playbackfiles set
      • setPlaybackURLs

        void setPlaybackURLs​(java.net.URL[] urls)
        Deprecated.
        Sets playback URL's to use.

        the size of the array must equal the number of lines opened.

        Parameters:
        urls - the URL array to play
      • setPlaybackInputStreams

        void setPlaybackInputStreams​(java.io.InputStream[] inputStreams)
        Deprecated.
        Sets playback Inputstreams to use.

        the size of the array must equal the number of lines opened.

        Parameters:
        inputStreams - the inputstream array to play
      • setPlaybackAudioSources

        void setPlaybackAudioSources​(AudioSource[] sources)
        Deprecated.
      • setOverwrite

        void setOverwrite​(boolean overwrite)
        Deprecated.
        Sets overwrite flag. If the overwrite flag is set, existing recording files are overwritten without any exception or warning.
        Parameters:
        overwrite - overwrite flag
      • isOverwrite

        boolean isOverwrite()
        Deprecated.
        Gets overwrite flag. If the overwrite flag is set, existing recording files are overwritten without any exception or warning.
        Returns:
        overwrite flag
      • setRecordingFiles

        void setRecordingFiles​(java.io.File[] recordingFiles)
        Deprecated.
        Sets recording files to use.

        the size of the array must equal the number of lines opened.

        Parameters:
        recordingFiles -
      • getRecordingFiles

        java.io.File[] getRecordingFiles()
        Deprecated.
        Gets recording files.

        the size of the array is equal the number of lines opened.

        Returns:
        recordingFiles
      • setRecordingOutputStreams

        void setRecordingOutputStreams​(java.io.OutputStream[] streams)
        Deprecated.
        Sets recording OutputStreams to use.

        the size of the array must equal the number of lines opened.

        Parameters:
        streams - recording OutputStreams
      • getLevels

        float[] getLevels()
        Deprecated.
        Gets levels of all channels. maximum level is 1.0 representing 0dB
        minimum level is 0
        array has channels * numLines entries
        Returns:
        current audio levels
      • isPlaybackRandomPositioningSupported

        boolean isPlaybackRandomPositioningSupported()
        Deprecated.
        Get random positioning capability of the playback engine.
        Returns:
        random positioning capability
      • getPlaybackFrameLength

        long getPlaybackFrameLength()
        Deprecated.
        Gets length of largest playback file in frames, -1 if not available
        Returns:
        length of largest playback file in frames
      • setPlaybackFramePosition

        long setPlaybackFramePosition​(long newPosition)
        Deprecated.
        Sets the new frame position of playback.
        Parameters:
        newPosition - the requested position
        Returns:
        the actually set position or POS_UNKNOWN (-1) if not supported
      • getPlaybackFramePosition

        long getPlaybackFramePosition()
        Deprecated.
        Get playback position.
        Returns:
        current playback position in audio frames or POS_UNKNOWN (-1) if not supported
      • setPlaybackStartFramePosition

        long setPlaybackStartFramePosition​(long startPosition)
        Deprecated.
        Sets the start position. Used to play only a segment of an audio file.
        Parameters:
        startPosition - position in audio frames from where to start
        Returns:
        the actually set start position
      • getPlaybackStartFramePosition

        long getPlaybackStartFramePosition()
        Deprecated.
        Gets the start position.
        Returns:
        start position
      • setPlaybackStopFramePosition

        long setPlaybackStopFramePosition​(long stopPosition)
        Deprecated.
        Sets the stop position. Used to play only a segment of an audio file. To play the whole audio file set the position to AUDIO_END (-1).
        Parameters:
        stopPosition - position in audio frames to stop
        Returns:
        the actually set stop position
      • getPlaybackStopFramePosition

        long getPlaybackStopFramePosition()
        Deprecated.
        Gets the stop position.
        Returns:
        stop position
      • getRecordingFramePosition

        long getRecordingFramePosition()
        Deprecated.
        Get recording position.
        Returns:
        current recording position in audio frames or -1 if not supported
      • getPropertyNames

        java.lang.String[] getPropertyNames()
        Deprecated.
        Get an implementation specific property names.
        Returns:
        property names
      • getPropertyDescription

        java.lang.String getPropertyDescription​(java.lang.String propertyName)
        Deprecated.
        Get a description of the property.
        Parameters:
        propertyName -
        Returns:
        description
      • setProperty

        void setProperty​(java.lang.String propertyName,
                         java.lang.String value)
        Deprecated.
        Set a property for a specific implementation.
        Parameters:
        propertyName -
        value -
      • getProperty

        java.lang.String getProperty​(java.lang.String propertyName)
        Deprecated.
        Get an implementation specific property.
        Parameters:
        propertyName -
        Returns:
        value of the property or null if there is no such property
      • setSettings

        void setSettings()
        Deprecated.
        Call the graphical user interface of the controller implementation to set the configuration.
      • addAudioControllerListener

        void addAudioControllerListener​(AudioControllerListener acl)
        Deprecated.
        Adds controller listener.
        Parameters:
        acl - controller listener
      • removeAudioControllerListener

        void removeAudioControllerListener​(AudioControllerListener acl)
        Deprecated.
        Removes controller listener.
        Parameters:
        acl - controller listener