Package org.openhab.core.audio
Class AudioStream
java.lang.Object
java.io.InputStream
org.openhab.core.audio.AudioStream
- All Implemented Interfaces:
Closeable,AutoCloseable
- Direct Known Subclasses:
ByteArrayAudioStream,FileAudioStream,FixedLengthAudioStream,PipedAudioStream,URLAudioStream
Wrapper for a source of audio data.
In contrast to AudioSource, this is often a "one time use" instance for passing some audio data,
but it is not meant to be registered as a service.
The stream needs to be closed by the client that uses it.
- Author:
- Harald Kuhn - Initial contribution, Kelly Davis - Modified to match discussion in #584, Kai Kreuzer - Refactored to be only a temporary instance for the stream
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract AudioFormatGets the supported audio format@Nullable StringgetId()Useful for sinks playing the same stream multiple times to avoid already done computation (like re-encoding).Methods inherited from class java.io.InputStream
available, close, mark, markSupported, nullInputStream, read, read, read, readAllBytes, readNBytes, readNBytes, reset, skip, skipNBytes, transferTo
-
Constructor Details
-
AudioStream
public AudioStream()
-
-
Method Details
-
getFormat
Gets the supported audio format- Returns:
- The supported audio format
-
getId
Useful for sinks playing the same stream multiple times to avoid already done computation (like re-encoding).- Returns:
- A string uniquely identifying the stream.
-