Skip to content

Commit

Permalink
Update AudioStreaming.kt
Browse files Browse the repository at this point in the history
Additional check to close request in case it fails.
  • Loading branch information
EngineMachiner committed Oct 5, 2023
1 parent 553a831 commit d68440b
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ private class DirectAudioStream( private val sound: ExternalSound ) : AudioStrea

private val zeroBuffer = BufferUtils.createByteBuffer(0)

init { if ( !response.isSuccessful ) close() }

override fun close() { newInputStream.close(); body.close(); sound.stop() }

override fun getFormat(): AudioFormat { return newFormat }
Expand Down

0 comments on commit d68440b

Please sign in to comment.