Package org.openhab.core.audio
Interface AudioSource
@NonNullByDefault
public interface AudioSource
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 TypeMethodDescriptiongetId()
Returns a simple string that uniquely identifies this servicegetInputStream
(AudioFormat format) Gets an AudioStream for reading audio data in supported audio formatReturns a localized human readable label that can be used within UIs.Obtain the audio formats supported by this AudioSource
-
Method Details
-
getId
String getId()Returns a simple string that uniquely identifies this service- Returns:
- an id that identifies this service
-
getLabel
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
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
-