Refactor waveform factory function
This commit is contained in:
parent
a07286ace9
commit
7ebea4acf1
3 changed files with 13 additions and 15 deletions
|
|
@ -20,17 +20,15 @@ import kotlinx.collections.immutable.ImmutableList
|
|||
import kotlinx.collections.immutable.toPersistentList
|
||||
import kotlin.random.Random
|
||||
|
||||
object FakeWaveformFactory {
|
||||
/**
|
||||
* Generate a waveform for testing purposes.
|
||||
*
|
||||
* The waveform is a list of floats between 0 and 1.
|
||||
*
|
||||
* @param length The length of the waveform.
|
||||
*/
|
||||
fun createFakeWaveform(length: Int = 1000): ImmutableList<Float> {
|
||||
val random = Random(seed = 2)
|
||||
return List(length) { random.nextFloat() }
|
||||
.toPersistentList()
|
||||
}
|
||||
/**
|
||||
* Generate a waveform for testing purposes.
|
||||
*
|
||||
* The waveform is a list of floats between 0 and 1.
|
||||
*
|
||||
* @param length The length of the waveform.
|
||||
*/
|
||||
fun createFakeWaveform(length: Int = 1000): ImmutableList<Float> {
|
||||
val random = Random(seed = 2)
|
||||
return List(length) { random.nextFloat() }
|
||||
.toPersistentList()
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue