Interface AudioPlayer

    • Method Detail

      • getAudioDevice

        AudioDevice getAudioDevice()
        Current audio device.
        Returns:
        currently used audio device
      • getSong

        AudioSong getSong()
        Returns the currently opened song.
        Returns:
        currently opened song
      • open

        void open​(AudioSong song)
           throws IOException
        Opens a song.
        Calling this method with null as argument has the same effect as calling close().
        Parameters:
        song - song
        Throws:
        IOException - if the song cannot be opened
      • play

        void play()
        Starts playback.
      • pause

        void pause()
        Stops playback.
      • playPause

        void playPause()
        Starts playback, if song is paused, otherwise pauses playback.
      • fastForward

        void fastForward()
        Plays the file forward at accelerated speed.
      • close

        void close()
        Closes the audio file and associated player resources.
      • reset

        void reset()
        Positions the player at the beginning of the file. Equivalent to calling setTime(long) with 0 as argument.
        See Also:
        setTime(long)
      • getTime

        long getTime()
        Returns the current time in ms.
        Returns:
        current time in ms
      • getDuration

        long getDuration()
        Duration of the song in ms.
        Returns:
        the overall duration of the song in ms.
      • isDone

        boolean isDone()
        True, if the song was played to the end.
        Returns:
        true if the song was played to the end.
      • isPaused

        boolean isPaused()
        Indicates whether the song is currently playing.
        Returns:
        false if the song is playing
      • getVolume

        float getVolume()
        Returns the volume.
        Returns:
        value between -1 and 1, negative values equating to silence
      • setVolume

        void setVolume​(float volume)
                throws IllegalArgumentException
        Changes the volume.
        Parameters:
        volume - value between -1 and 1, negative values equating to silence. A volume value outside the valid range will lead to an IllegalArgumentException
        Throws:
        IllegalArgumentException - if the value is outside the valid range
      • setMuted

        void setMuted​(boolean muted)
        Un/mutes this player.
        Parameters:
        muted - muted
      • isMuted

        boolean isMuted()
        Indicates whether the player is muted.
        Returns:
        true to false
      • setReplayGainType

        void setReplayGainType​(ReplayGain.Type type)
        Asks the player to respect the given kind of replay gain. Some players may ignore this property.
        Parameters:
        type - type
      • getReplayGainType

        ReplayGain.Type getReplayGainType()
        Currently configured type of replay gain.
        Returns:
        replay gain type
      • removePropertyChangeListener

        void removePropertyChangeListener​(PropertyChangeListener propertyChangeListener)
      • addPropertyChangeListener

        void addPropertyChangeListener​(PropertyChangeListener propertyChangeListener)