com.github.stephengold:j-ogg-all

J-Ogg is a collection of Java libraries for reading Ogg files and decoding different contained formats.


Keywords
audio, codec, decoder, flac, java, library, mdct, ogg, ogg-vorbis, open-source, streaming-audio, vorbis
Licenses
AFL-3.0/CC-BY-NC-2.5/BSD-3-Clause-Attribution

Documentation

J-ogg-all Project

The J-ogg-all Project provides 2 JVM libraries for reading Ogg bitstreams and decoding media they contain.

It contains 2 sub-projects:

  1. library: builds the full "j-ogg-all" runtime library, including decoders for Vorbis, Free Lossless Audio Codec (FLAC), and Theora media. This library also provides optional interfaces to the Java Media Framework (JMF).
  2. vorbis: builds a reduced library ("j-ogg-vorbis") for decoding Vorbis audio only (no support for FLAC, Theora, or JMF).

Complete source code (in Java) is provided under an informal license.

Contents of this document

Important features

  • read bitstreams and metadata from Ogg containers
  • decode Vorbis audio
  • decode FLAC audio
  • extract album art from Vorbis comments

Jump to table of contents

What's missing

Jump to table of contents

How to add j-ogg-all to an existing project

The j-ogg-all library is available pre-built. It depends on the Java Media Framework. Adding j-ogg-all to an existing JVM project should be a simple matter of adding these libraries to the classpath.

For projects built using Maven or Gradle, it is sufficient to add a dependency on j-ogg-all. Build tools should automatically resolve the dependency on JMF.

Gradle-built projects

Add to the project’s "build.gradle" file:

repositories {
    mavenCentral()
}
dependencies {
    implementation 'com.github.stephengold:j-ogg-all:1.0.4'
}

For some older versions of Gradle, it's necessary to replace implementation with compile.

Maven-built projects

Add to the project’s "pom.xml" file:

<repositories>
  <repository>
    <id>mvnrepository</id>
    <url>https://repo1.maven.org/maven2/</url>
  </repository>
</repositories>

<dependency>
  <groupId>com.github.stephengold</groupId>
  <artifactId>j-ogg-all</artifactId>
  <version>1.0.4</version>
</dependency>

Jump to table of contents

How to add j-ogg-vorbis to an existing project

The j-ogg-vorbis library is available pre-built. Adding j-ogg-vorbis to an existing JVM project should be a simple matter of adding this library to the classpath.

Gradle-built projects

Add to the project’s "build.gradle" file:

repositories {
    mavenCentral()
}
dependencies {
    implementation 'com.github.stephengold:j-ogg-vorbis:1.0.4'
}

For some older versions of Gradle, it's necessary to replace implementation with compile.

Maven-built projects

Add to the project’s "pom.xml" file:

<repositories>
  <repository>
    <id>mvnrepository</id>
    <url>https://repo1.maven.org/maven2/</url>
  </repository>
</repositories>

<dependency>
  <groupId>com.github.stephengold</groupId>
  <artifactId>j-ogg-vorbis</artifactId>
  <version>1.0.4</version>
</dependency>

Jump to table of contents

How to build the project from source

  1. Install a Java Development Kit (JDK), if you don't already have one.
  2. Point the JAVA_HOME environment variable to your JDK installation: (The path might be something like "C:\Program Files\Java\jre1.8.0_301" or "/usr/lib/jvm/java-8-openjdk-amd64/" or "/Library/Java/JavaVirtualMachines/liberica-jdk-17-full.jdk/Contents/Home" .)
  • using Bash or Zsh: export JAVA_HOME=" path to installation "
  • using Windows Command Prompt: set JAVA_HOME=" path to installation "
  • using PowerShell: $env:JAVA_HOME = ' path to installation '
  1. Download and extract the j-ogg-all source code from GitHub:
  • using Git:
    • git clone https://github.com/stephengold/j-ogg-all.git
    • cd j-ogg-all
    • git checkout -b latest 1.0.4
  • using a web browser:
    • browse to the latest release
    • follow the "Source code (zip)" link
    • save the ZIP file
    • extract the contents of the saved ZIP file
    • cd to the extracted directory/folder
  1. Run the Gradle wrapper:
  • using Bash or PowerShell or Zsh: ./gradlew build
  • using Windows Command Prompt: .\gradlew build

After a successful build, Maven artifacts will be found in "library/build/libs" and "vorbis/build/libs".

You can install the artifacts to your local Maven repository:

  • using Bash or PowerShell or Zsh: ./gradlew install
  • using Windows Command Prompt: .\gradlew install

You can restore the project to a pristine state:

  • using Bash or PowerShell or Zsh: ./gradlew clean
  • using Windows Command Prompt: .\gradlew clean

Jump to table of contents

Downloads

Releases can be downloaded from GitHub or from the Maven Central Repository:

Jump to table of contents

Conventions

Package names begin with de.jarnbjo.

The source code is compatible with JDK 7. The pre-built libraries are compatible with JDK 8.

Jump to table of contents

External links

Jump to table of contents

History

The j-ogg-all project was created by Tor-Einar Jarnbjo circa 2002, probably based on reference implementations in C.

In March 2021, Stephen Gold revived the project at GitHub and added Gradle build scripts.

In September 2022, Robert Pengelly contributed code to retrieve album art from Vorbis media.

In February 2023, the "library" and "vorbis" subprojects split off.

Jump to table of contents