Let the test use sample data.
This commit is contained in:
parent
26fcd1567c
commit
d8f84e5e55
2 changed files with 2 additions and 27 deletions
|
|
@ -1,25 +0,0 @@
|
|||
/*
|
||||
* Copyright 2023, 2024 New Vector Ltd.
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
|
||||
* Please see LICENSE files in the repository root for full details.
|
||||
*/
|
||||
|
||||
package io.element.android.libraries.designsystem.components.media
|
||||
|
||||
import kotlinx.collections.immutable.ImmutableList
|
||||
import kotlinx.collections.immutable.toImmutableList
|
||||
import kotlin.random.Random
|
||||
|
||||
/**
|
||||
* 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() }
|
||||
.toImmutableList()
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue