X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;ds=sidebyside;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsonitus%2Fdata%2FFilter.java;h=2b27e9f78ec6098c175aab26c196eeb179281ebd;hb=3a12209e82233cd79677a0d847321f41b41aa9a5;hp=ec8fb94d74da19e6305f63e78760a543341af3e4;hpb=58ada95cc9cda6e07371c5c560736bbb4eeba9da;p=sonitus.git diff --git a/src/main/java/net/pterodactylus/sonitus/data/Filter.java b/src/main/java/net/pterodactylus/sonitus/data/Filter.java index ec8fb94..2b27e9f 100644 --- a/src/main/java/net/pterodactylus/sonitus/data/Filter.java +++ b/src/main/java/net/pterodactylus/sonitus/data/Filter.java @@ -80,13 +80,15 @@ public interface Filter { * * @param bufferSize * The maximum amount of bytes to retrieve from the audio stream - * @return A buffer filled with up to {@code bufferSize} bytes of data; the + * @return A data packet containing the metadata of the stream (optional) and + * the buffer filled with up to {@code bufferSize} bytes of data; the * returned buffer may contain less data than requested but will not - * contain excess elements + * contain excess elements (i.e. it can be smaller than the requested + * size) * @throws IOException * if an I/O error occurs */ - byte[] get(int bufferSize) throws IOException; + DataPacket get(int bufferSize) throws IOException; /** * Opens this sink using the format parameters of the given metadata. @@ -102,13 +104,13 @@ public interface Filter { void close(); /** - * Processes the given buffer of data. + * Processes the given data packet. * - * @param buffer + * @param dataPacket * The data to process * @throws IOException * if an I/O error occurs */ - void process(byte[] buffer) throws IOException; + void process(DataPacket dataPacket) throws IOException; }