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 397c12d commit 488e596
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 488e596

Please sign in to comment.