Coder Social home page Coder Social logo

stephengold / j-ogg-all Goto Github PK

View Code? Open in Web Editor NEW
11.0 5.0 6.0 1.85 MB

Open-source JVM libraries for reading Ogg bitstreams and decoding the media they contain.

License: Other

Java 100.00%
ogg audio streaming-audio java codec vorbis flac decoder ogg-vorbis mdct

j-ogg-all's Introduction

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 subprojects:

  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 the table of contents

What's missing

Jump to the 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. The build tool should automatically resolve the dependency on JMF.

Gradle-built projects

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

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

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.5</version>
</dependency>

Jump to the 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.5")
}

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.5</version>
</dependency>

Jump to the 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: (In other words, set it to the path of a directory/folder containing a "bin" that contains a Java executable. That path might look something like "C:\Program Files\Eclipse Adoptium\jdk-17.0.3.7-hotspot" or "/usr/lib/jvm/java-17-openjdk-amd64/" or "/Library/Java/JavaVirtualMachines/zulu-17.jdk/Contents/Home" .)
  • using Bash or Zsh: export JAVA_HOME=" path to installation "
  • using Fish: set -g 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.5
  • 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 Fish 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 Fish or PowerShell or Zsh: ./gradlew install
  • using Windows Command Prompt: .\gradlew install

You can restore the project to a pristine state:

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

Jump to the table of contents

Downloads

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

Jump to the 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 the table of contents

External links

Jump to the 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 the table of contents

j-ogg-all's People

Contributors

ebourg avatar riccardobl avatar robertapengelly avatar stephengold avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

j-ogg-all's Issues

Extract album art.

Not exactly an issue but how do you extract the album art? I know that it's within the comment header identified by METADATA_BLOCK_PICTURE and that it's base64 encoded, I just don't know how to extract the image after decoding it as it starts with 8 bytes before the mimetype and I don't know how to get to the actual image data.

I tried googling it but I can't find anything (at least nothing that helps) and I've looked at other projects but they don't seem to have an implementation to extract the image.

Fails to play local files.

If I use a URL to play a file then it works as expected but when I download the file and try playing it locally I get a header error.

Screenshot from 2022-09-24 04-26-04

It finds the first header but not any other headers after that as its all zeros (I think the getNextOggPacket() maybe returning null).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.