Skip to content

lavalink-devs/lavadsp

 
 

Repository files navigation

lavadsp

A bunch of lavaplayer audio filters implemented with native code forked from https://github.com/natanbc/lavadsp with mac m1 natives fixes

Getting Started

Installing

Replace VERSION with the version you want to use. The latest version can be found in the badge above.

Gradle

repositories {
    maven{ "http://maven.arbjerg.dev/releases" }
}

dependencies {
    compile "dev.arbjerg:lavadsp:VERSION"
}

Maven

<repositories>
    <repository>
        <id>arbjerg</id>
        <name>arbjerg</name>
        <url>http://maven.arbjerg.dev/releases</url>
    </repository>
</repositories>

<dependencies>
    <dependency>
        <groupId>dev.arbjerg</groupId>
        <artifactId>lavadsp</artifactId>
        <version>VERSION</version>
    </dependency>
</dependencies>

Basic Usage

AudioPlayer player = manager.createPlayer();
player.setFilterFactory((track, format, output)->{
    TimescalePcmAudioFilter audioFilter = new TimescalePcmAudioFilter(output, format.channelCount, format.sampleRate);
    audioFilter.setSpeed(1.5); //1.5x normal speed
    return Collections.singletonList(audioFilter);
});

Chaining

Filters may be chained to merge their effects:

AudioPlayer player = manager.createPlayer();
player.setFilterFactory((track, format, output)->{
    TremoloPcmAudioFilter tremolo = new TremoloPcmAudioFilter(output, format.channelCount, format.sampleRate);
    tremolo.setDepth(0.75);
    TimescalePcmAudioFilter timescale = new TimescalePcmAudioFilter(tremolo, format.channelCount, format.sampleRate);
    timescale.setSpeed(1.5);
    return Arrays.asList(timescale, tremolo);
});

To dynamically choose which filters to use, you can see this example

About

A bunch of lavaplayer audio filters

Resources

License

Stars

Watchers

Forks

Languages

  • C 58.7%
  • C++ 30.2%
  • Java 11.1%