summaryrefslogtreecommitdiff
path: root/core/src/commonTest/kotlin/coffee/liz/rookery/ChimeTest.kt
blob: 7ab195c88675f314961275ec6eddaea0dba16011 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
package coffee.liz.rookery

import coffee.liz.rookery.audio.Chime
import kotlin.test.Test
import kotlin.test.assertTrue

class ChimeTest {
    @Test fun rendersAudibleShortJingle() {
        val pcm = Chime.render(Chime.PB)
        val seconds = pcm.size.toDouble() / Chime.SAMPLE_RATE
        assertTrue(seconds in 0.8..3.0, "length $seconds")
        assertTrue(pcm.maxOf { it.toInt() } > 3000)
    }
}