A bunch of lavaplayer audio filters implemented with native code
Replace VERSION
with the version you want to use. The latest version can be found in the badge above.
<repositories>
<repository>
<id>jcenter</id>
<name>jcenter</name>
<url>http://jcenter.bintray.com/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>com.github.natanbc</groupId>
<artifactId>lavadsp</artifactId>
<version>VERSION</version>
</dependency>
</dependencies>
repositories {
jcenter()
}
dependencies {
compile 'com.github.natanbc:lavadsp:VERSION'
}
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);
});
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