Package org.openhab.core.audio.utils
Interface AudioSinkUtils
- All Known Implementing Classes:
AudioSinkUtilsImpl
@NonNullByDefault
public interface AudioSinkUtils
Some utility methods for sink
- Author:
- Gwendal Roulleau - Initial contribution
-
Method Summary
Modifier and TypeMethodDescription@Nullable Long
transferAndAnalyzeLength
(InputStream in, OutputStream out, AudioFormat audioFormat) Transfers data from an input stream to an output stream and computes on the fly its duration
-
Method Details
-
transferAndAnalyzeLength
@Nullable Long transferAndAnalyzeLength(InputStream in, OutputStream out, AudioFormat audioFormat) throws IOException Transfers data from an input stream to an output stream and computes on the fly its duration- 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
-