Skip to content

Commit 2523c54

Browse files
committed
Fix tests
1 parent 51b600c commit 2523c54

File tree

1 file changed

+2
-1
lines changed
  • tiny-engine/src/commonMain/kotlin/com/github/minigdx/tiny/sound

1 file changed

+2
-1
lines changed

tiny-engine/src/commonMain/kotlin/com/github/minigdx/tiny/sound/SoundManager.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,8 @@ abstract class SoundManager {
320320
* Quiet signals pass through nearly unaffected.
321321
*/
322322
fun softClip(sample: Float): Float {
323-
return tanh(sample * 1.5f) * TANH_NORM
323+
val clipped = tanh(sample * 1.5f) * TANH_NORM
324+
return max(-1.0f, min(1.0f, clipped))
324325
}
325326
}
326327
}

0 commit comments

Comments
 (0)