Skip to content
forked from sedmelluq/jda-nas

Send JDA audio packets from a queue kept in a native library to avoid stutters due to GC pauses

Notifications You must be signed in to change notification settings

FredBoat/jda-nas

 
 

Repository files navigation

What the fork is this?

The FredBoat team uses this fork of jda-nas to try out adjustments before committing them back upstream.

JDA-NAS - JDA Native Audio System

JDA-NAS is an alternative to JDA's built-in audio packet sending system. It keeps a buffer of audio packets in native code and also sends them from there. This way it is unaffected by GC pauses shorter than the duration of the buffer (400ms by default) and gets rid of stuttering caused by those.

Maven package

  • Repository: jitpack.io
  • Artifact: com.github.FredBoat:jda-nas:1.0.5.1-JDA or com.github.FredBoat:jda-nas:1.0.5.1-JDA-Audio depending whether you are using the full JDA lib or the audio-only spin-off JDA-Audio

Using in Gradle:

repositories {
  maven {
    url 'https://jitpack.io'
  }
}

dependencies {
  compile 'com.github.FredBoat:jda-nas:1.0.5.1-JDA'
  //or
  compile 'com.github.FredBoat:jda-nas:1.0.5.1-JDA-Audio'
}

Using in Maven:

<repositories>
  <repository>
    <id>jitpack.io</id>
    <url>https://jitpack.io</url>
  </repository>
</repositories>

<dependencies>
  <dependency>
    <groupId>com.github.FredBoat</groupId>
    <artifactId>jda-nas</artifactId>
    <version>1.0.5.1-JDA</version>
    <!-- or -->
    <version>1.0.5.1-JDA-Audio</version>
  </dependency>
</dependencies>

Usage

Using it is as simple as just calling calling this on a JDABuilder:

.setAudioSendFactory(new NativeAudioSendFactory())

For example:

new JDABuilder(AccountType.BOT)
    .setToken(System.getProperty("botToken"))
    .setAudioSendFactory(new NativeAudioSendFactory())
    .buildBlocking()

Supported platforms

As it includes a native library, it is only supported on a specific set of platforms currently:

  • Windows (x86 and x64)
  • Linux (x86 and x64, glibc >= 2.15)

About

Send JDA audio packets from a queue kept in a native library to avoid stutters due to GC pauses

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C 68.1%
  • Java 27.6%
  • CMake 3.4%
  • C++ 0.9%