Skip to content

Commit

Permalink
Configure buffer size
Browse files Browse the repository at this point in the history
  • Loading branch information
freyacodes committed Apr 10, 2020
1 parent fba2693 commit adb43de
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,13 @@ class KoeConfiguration(val serverConfig: ServerConfig) {

if (nasSupported) {
log.info("Enabling JDA-NAS")
setFramePollerFactory(UdpQueueFramePollerFactory())
var bufferSize = serverConfig.bufferDurationMs ?: UdpQueueFramePollerFactory.DEFAULT_BUFFER_DURATION
if (bufferSize <= 0) {
log.warn("Buffer size of {}ms is illegal. Defaulting to {}",
bufferSize, UdpQueueFramePollerFactory.DEFAULT_BUFFER_DURATION)
bufferSize = UdpQueueFramePollerFactory.DEFAULT_BUFFER_DURATION
}
setFramePollerFactory(UdpQueueFramePollerFactory(bufferSize))
} else {
log.warn("This system and architecture appears to not support native audio sending! "
+ "GC pauses may cause your bot to stutter during playback.")
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ subprojects {
//@formatter:off
lavaplayerVersion = '1.3.46'
lavaplayerIpRotatorVersion = '0.1.7'
koeVersion = '7c5fa6e'
koeVersion = '98af1e8'

springBootVersion = "${springBootVersion}"
springWebSocketVersion = '5.1.9.RELEASE'
Expand Down

0 comments on commit adb43de

Please sign in to comment.