Closed bam-e22 closed 1 year ago
The issue is when minHeight = maxHeight, the diff becomes 0 and div by zero returns NaN, see #L147
For now I'm just using a workaround normalize(minHeight, maxHeight).map { if (it.isNaN()) 0f else it }
I face this issue too
@Xing1P for now you can try this fix https://github.com/lincollincol/compose-audiowaveform/pull/20/files
@lincollincol just a friendly reminder. If you're free, please have a look at #20
App crashes when using silent audio source ex) amplitudes = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]