Package com.tino1b2be.dtmf
Interface DtmfStream.SampleSource
- Enclosing class:
- DtmfStream
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
A source of
double PCM samples for
DtmfStream.fromSource(SampleSource, DtmfConfig). Callers implement this
as a functional interface, typically a lambda wrapping a file, socket,
or pre-buffered array.
The return value follows the InputStream convention:
a non-negative integer is the number of samples written into
buffer starting at offset, and -1 signals
end-of-stream.
-
Method Summary
Modifier and TypeMethodDescriptionintreadInto(double[] buffer, int offset, int length) Read up tolengthsamples intobuffer[offset .. offset + length).
-
Method Details
-
readInto
int readInto(double[] buffer, int offset, int length) Read up tolengthsamples intobuffer[offset .. offset + length).- Parameters:
buffer- destination buffer; non-nulloffset- starting index;0 <= offset <= buffer.lengthlength- maximum number of samples to write;0 <= length && offset + length <= buffer.length- Returns:
- the number of samples written (
0 <= n <= length), or-1to signal end-of-stream
-