mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-02 12:07:28 +00:00
Refactor waveform factory function
This commit is contained in:
+11
-13
@@ -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()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user