diff --git a/src/main/kotlin/dev/jombi/copytotrans/Main.kt b/src/main/kotlin/dev/jombi/copytotrans/Main.kt index 2ff699a..957b561 100644 --- a/src/main/kotlin/dev/jombi/copytotrans/Main.kt +++ b/src/main/kotlin/dev/jombi/copytotrans/Main.kt @@ -10,14 +10,14 @@ import dev.jombi.copytotrans.translator.impl.newg.FailedToTranslateException import java.awt.Toolkit import java.awt.datatransfer.DataFlavor import java.awt.datatransfer.StringSelection +import java.io.BufferedInputStream import javax.sound.sampled.AudioSystem import javax.sound.sampled.Clip import javax.sound.sampled.DataLine import javax.sound.sampled.LineEvent -import kotlin.io.path.Path -import kotlin.io.path.inputStream import kotlin.system.exitProcess + fun main() { makeDefaultConfig() val clipboard = Toolkit.getDefaultToolkit().systemClipboard @@ -69,7 +69,7 @@ fun main() { fun playFinishedSound() { if (!shouldPlaySound()) return try { - val stream = AudioSystem.getAudioInputStream(Path("res/sharexfinish.wav").inputStream()) + val stream = AudioSystem.getAudioInputStream(BufferedInputStream(ClassLoader.getSystemResourceAsStream("sharexfinish.wav")!!)) val format = stream.format val info = DataLine.Info(Clip::class.java, format) val clip = AudioSystem.getLine(info) as Clip diff --git a/res/sharexfinish.wav b/src/main/resources/sharexfinish.wav similarity index 100% rename from res/sharexfinish.wav rename to src/main/resources/sharexfinish.wav