Interface AudioSink


  • @NonNullByDefault
    public interface AudioSink
    Definition of an audio output like headphones, a speaker or for writing to a file / clip.
    Author:
    Harald Kuhn - Initial contribution, Kelly Davis - Modified to match discussion in #584, Christoph Weitkamp - Added getSupportedStreams() and UnsupportedAudioStreamException
    • Method Detail

      • getId

        String getId()
        Returns a simple string that uniquely identifies this service
        Returns:
        an id that identifies this service
      • getLabel

        @Nullable String getLabel​(@Nullable Locale locale)
        Returns a localized human readable label that can be used within UIs.
        Parameters:
        locale - the locale to provide the label for
        Returns:
        a localized string to be used in UIs
      • getSupportedFormats

        Set<AudioFormat> getSupportedFormats()
        Gets a set containing all supported audio formats
        Returns:
        A Set containing all supported audio formats
      • getSupportedStreams

        Set<Class<? extends AudioStream>> getSupportedStreams()
        Gets a set containing all supported audio stream formats
        Returns:
        A Set containing all supported audio stream formats
      • getVolume

        PercentType getVolume()
                       throws IOException
        Gets the volume
        Returns:
        a PercentType value between 0 and 100 representing the actual volume
        Throws:
        IOException - if the volume can not be determined
      • setVolume

        void setVolume​(PercentType volume)
                throws IOException
        Sets the volume
        Parameters:
        volume - a PercentType value between 0 and 100 representing the desired volume
        Throws:
        IOException - if the volume can not be set