Package org.openhab.core.audio
Class URLAudioStream
java.lang.Object
java.io.InputStream
org.openhab.core.audio.AudioStream
org.openhab.core.audio.URLAudioStream
- All Implemented Interfaces:
Closeable
,AutoCloseable
,ClonableAudioStream
This is an AudioStream from a URL. Note that some sinks, like Sonos, can directly handle URL
based streams, and therefore can/should call getURL() to get a direct reference to the URL.
- Author:
- Karel Goderis - Initial contribution, Kai Kreuzer - Refactored to not require a source, Christoph Weitkamp - Refactored use of filename extension
-
Field Summary
-
Constructor Summary
-
Method Summary
Methods inherited from class org.openhab.core.audio.AudioStream
getId
Methods inherited from class java.io.InputStream
available, mark, markSupported, nullInputStream, read, read, readAllBytes, readNBytes, readNBytes, reset, skip, skipNBytes, transferTo
-
Field Details
-
M3U_EXTENSION
- See Also:
-
PLS_EXTENSION
- See Also:
-
-
Constructor Details
-
URLAudioStream
- Throws:
AudioException
-
-
Method Details
-
getFormat
Description copied from class:AudioStream
Gets the supported audio format- Specified by:
getFormat
in classAudioStream
- Returns:
- The supported audio format
-
read
- Specified by:
read
in classInputStream
- Throws:
IOException
-
getURL
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classInputStream
- Throws:
IOException
-
toString
-
getClonedStream
Description copied from interface:ClonableAudioStream
Returns a new, fully independent stream instance, which can be read and closed without impacting the original instance.- Specified by:
getClonedStream
in interfaceClonableAudioStream
- Returns:
- a new input stream that can be consumed by the caller
- Throws:
AudioException
- if stream cannot be created
-