Giter Club home page Giter Club logo

lame4j's Introduction

Lame4J

A Java wrapper for LAME written in Rust using JNI. This also includes minimp3 to decode mp3 files.

This library includes natives for:

  • Windows x86
  • Windows x64
  • MacOS x64
  • MacOS aarch64
  • Linux x86
  • Linux x64
  • Linux aarch64

Usage

Maven

<dependency>
  <groupId>de.maxhenkel.lame4j</groupId>
  <artifactId>lame4j</artifactId>
  <version>2.0.3</version>
</dependency>

<repositories>
  <repository>
    <id>henkelmax.public</id>
    <url>https://maven.maxhenkel.de/repository/public</url>
  </repository>
</repositories>

Gradle

dependencies {
  implementation 'de.maxhenkel.lame4j:lame4j:2.0.3'
}

repositories {
  maven {
    name = "henkelmax.public"
    url = 'https://maven.maxhenkel.de/repository/public'
  }
}

Example

DecodedAudio decodedAudio = Mp3Decoder.decode(Files.newInputStream(Paths.get("myfile.mp3")));

short[] decode = decodedAudio.getSamples();

System.out.println("Sample Rate: " + decodedAudio.getSampleRate());
System.out.println("Bit Rate: " + decodedAudio.getBitRate());
System.out.println("Channels: " + decodedAudio.getChannelCount());
System.out.println("Frame Size: " + decodedAudio.getSampleSizeInBits());

System.out.println("Length: " + decode.length + " samples");
System.out.println("Duration: " + ((float) decode.length / (float) decodedAudio.getSampleRate()) + " seconds");

Mp3Encoder encoder = new Mp3Encoder(decodedAudio.getChannelCount(), decodedAudio.getSampleRate(), decodedAudio.getBitRate(), 5, Files.newOutputStream(Paths.get(args[1])));
encoder.write(decode);
encoder.close();

Credits

Other stuff

lame4j's People

Contributors

evrooije avatar henkelmax avatar

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.