Always treat waveform as List<Float> (#1663)

[MSC3246](https://github.com/matrix-org/matrix-spec-proposals/pull/3246) specifies the waveform as a list of ints because:

> Because floating point numbers are not allowed in Matrix events

Though DSP on audio data is almost always done using their floating point representation.
This PR brings the float<->int rescaling in the `matrix` module so that the application code can always work with float waveform samples.
This commit is contained in:
Marco Romano 2023-10-27 14:49:58 +02:00 committed by GitHub
parent a6e4644cfa
commit 0e4141863b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 28 additions and 41 deletions

View file

@ -20,5 +20,5 @@ import java.time.Duration
data class AudioDetails(
val duration: Duration,
val waveform: List<Int>,
val waveform: List<Float>,
)

View file

@ -195,7 +195,7 @@ interface MatrixRoom : Closeable {
suspend fun sendVoiceMessage(
file: File,
audioInfo: AudioInfo,
waveform: List<Int>,
waveform: List<Float>,
progressCallback: ProgressCallback?
): Result<MediaUploadHandler>