Skip to content

Commit

Permalink
fixed IOE: mark/reset not supported
Browse files Browse the repository at this point in the history
  • Loading branch information
jombidev committed Apr 22, 2023
1 parent d14a47c commit f4f0dab
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/kotlin/dev/jombi/copytotrans/Main.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
File renamed without changes.

0 comments on commit f4f0dab

Please sign in to comment.