Skip to content

Commit

Permalink
Remove yields that make process slow
Browse files Browse the repository at this point in the history
  • Loading branch information
sdercolin committed Jul 31, 2024
1 parent d3c8cc8 commit 16150fc
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 2 deletions.
1 change: 0 additions & 1 deletion src/jvmMain/kotlin/com/sdercolin/vlabeler/io/Wave.kt
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ suspend fun loadSampleChunk(
stream.skip(offset * frameSize)
Log.debug("Loading chunk $chunkIndex: offset=$offset")
val readSize = stream.readNBytes(buffer, 0, chunkSize * frameSize)
yield()
val readFrameCount = readSize / frameSize
for (frameIndex in 0 until readFrameCount) {
val frameStart = frameIndex * frameSize
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,6 @@ data class SampleInfo(
val buffer = ByteArray(frameSize)
var maxAbsolute = 0f
while (true) {
yield()
val readSize = stream.readNBytes(buffer, 0, frameSize)
if (readSize == 0) break
for (channelIndex in 0 until format.channels) {
Expand Down

0 comments on commit 16150fc

Please sign in to comment.