jukebox: speaker sim using convolver

This commit is contained in:
minjaesong
2024-01-12 19:55:36 +09:00
parent 40365fd828
commit 988c9dbff7
8 changed files with 34 additions and 12 deletions

View File

@@ -20,8 +20,9 @@ import java.io.File
import kotlin.math.roundToInt
/**
* @param ir Binary file containing MONO IR
* @param crossfeed The amount of channel crossfeeding to simulate the stereo ID
* @param ir Binary file containing MONO IR (containing only two channels)
* @param crossfeed The amount of channel crossfeeding to simulate the true stereo IR. Fullscale (0.0 - 1.0)
* @param gain output gain. Fullscale (0.0 - 1.0)
*/
class Convolv(ir: File, val crossfeed: Float, gain: Float = 1f / 256f): TerrarumAudioFilter() {
private val gain: Float = gain / (1f + crossfeed)