Interface AudioSource

All Superinterfaces:
Identifiable<String>

@NonNullByDefault public interface AudioSource extends Identifiable<String>
This is an audio source, which can provide a continuous live stream of audio. Its main use is for microphones and other "line-in" sources and it can be registered as a service in order to make it available throughout the system.
Author:
Kai Kreuzer - Initial contribution
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns a simple string that uniquely identifies this service
    Gets an AudioStream for reading audio data in supported audio format
    getLabel(@Nullable Locale locale)
    Returns a localized human readable label that can be used within UIs.
    Obtain the audio formats supported by this AudioSource
    default String
    Get the unique identifier.
  • Method Details

    • getId

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

      default String getUID()
      Description copied from interface: Identifiable
      Get the unique identifier.
      Specified by:
      getUID in interface Identifiable<String>
      Returns:
      the unique identifier
    • getLabel

      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()
      Obtain the audio formats supported by this AudioSource
      Returns:
      The audio formats supported by this service
    • getInputStream

      AudioStream getInputStream(AudioFormat format) throws AudioException
      Gets an AudioStream for reading audio data in supported audio format
      Parameters:
      format - the expected audio format of the stream
      Returns:
      AudioStream for reading audio data
      Throws:
      AudioException - If problem occurs obtaining the stream