Skip to content

Commit cdab315

Browse files
committed
New lavaplayer with replaygain fixes.
1 parent b58e4d2 commit cdab315

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ dependencies {
5252
// implementation("dev.arbjerg:lavaplayer:2.2.6")
5353
// Above broken for YouTube links. Use Justin's fork.
5454
// https://github.com/JustinFreitas/lavaplayer
55-
implementation("com.github.justinfreitas:lavaplayer:v2.2.6_2")
55+
implementation("com.github.justinfreitas:lavaplayer:v2.2.6_3")
5656
// https://github.com/lavalink-devs/youtube-source
5757
implementation("dev.lavalink.youtube:v2:1.16.0")
5858
implementation("dev.lavalink.youtube:common:1.16.0")

src/main/kotlin/dev/arbjerg/ukulele/audio/Player.kt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package dev.arbjerg.ukulele.audio
22

3+
import com.sedmelluq.discord.lavaplayer.format.OpusAudioDataFormat
34
import com.sedmelluq.discord.lavaplayer.player.AudioPlayer
45
import com.sedmelluq.discord.lavaplayer.player.AudioPlayerManager
56
import com.sedmelluq.discord.lavaplayer.player.event.AudioEventAdapter
@@ -37,7 +38,7 @@ class Player(private val beans: Beans, guildProperties: GuildProperties) : Audio
3738
addListener(this@Player)
3839
volume = scaleVolume(guildProperties.volume)
3940
}
40-
private val buffer = ByteBuffer.allocate(1024)
41+
private val buffer = ByteBuffer.allocate(4096)
4142
private val frame: MutableAudioFrame = MutableAudioFrame().apply { setBuffer(buffer) }
4243
private val log: Logger = LoggerFactory.getLogger(Player::class.java)
4344

@@ -217,5 +218,7 @@ class Player(private val beans: Beans, guildProperties: GuildProperties) : Audio
217218
return buffer
218219
}
219220

220-
override fun isOpus() = true
221+
override fun isOpus(): Boolean {
222+
return frame.format is OpusAudioDataFormat
223+
}
221224
}

0 commit comments

Comments
 (0)