import java.io.IOException;
import java.io.InputStream;
-import net.pterodactylus.sonitus.data.Format;
+import net.pterodactylus.sonitus.data.Metadata;
import com.google.common.base.Optional;
import com.jcraft.jogg.Packet;
import com.jcraft.jorbis.Info;
/**
- * Identifies Ogg Vorbis files.
+ * Identifies Ogg Vorbis files. <p> All knowledge used in this class has been
+ * taken from <a href="http://www.jcraft.com/jorbis/tutorial/Tutorial.html">jcraft.com/jorbis/tutorial/Tutorial.html</a>.
+ * </p>
*
* @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
*/
/**
* Tries to parse the given stream as Ogg Vorbis file and returns a {@link
- * Format} describing the stream.
+ * Metadata} describing the stream.
*
* @param inputStream
* The input stream to identify as Ogg Vorbis
- * @return The identified format, or {@link com.google.common.base.Optional#absent()}
- * if the stream could not be identified
+ * @return The identified metadata, or {@link Optional#absent()} if the stream
+ * could not be identified
* @throws IOException
* if an I/O error occurs
*/
- public static Optional<Format> identify(InputStream inputStream) throws IOException {
+ public static Optional<Metadata> identify(InputStream inputStream) throws IOException {
/* stuff needed to decode Ogg. */
Packet packet = new Packet();
buffer = syncState.data;
}
- return Optional.of(new Format(info.channels, info.rate, "Vorbis"));
+ return Optional.of(new Metadata(info.channels, info.rate, "Vorbis"));
}
}