Package org.openhab.core.audio.utils
Class AudioSinkUtilsImpl
java.lang.Object
org.openhab.core.audio.utils.AudioSinkUtilsImpl
- All Implemented Interfaces:
AudioSinkUtils
Some utility methods for sink
- Author:
- Gwendal Roulleau - Initial contribution
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@Nullable LongtransferAndAnalyzeLength(InputStream in, OutputStream out, AudioFormat audioFormat) Transfers data from an input stream to an output stream and computes on the fly its duration
-
Constructor Details
-
AudioSinkUtilsImpl
public AudioSinkUtilsImpl()
-
-
Method Details
-
transferAndAnalyzeLength
public @Nullable Long transferAndAnalyzeLength(InputStream in, OutputStream out, AudioFormat audioFormat) throws IOException Description copied from interface:AudioSinkUtilsTransfers data from an input stream to an output stream and computes on the fly its duration- Specified by:
transferAndAnalyzeLengthin interfaceAudioSinkUtils- Parameters:
in- the input stream giving audio data ta playout- the output stream receiving data to play- Returns:
- the timestamp (from System.nanoTime) when the sound should be fully played. Returns null if computing time fails.
- Throws:
IOException- if reading from the stream or writing to the stream failed
-