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:
parent
a6e4644cfa
commit
0e4141863b
10 changed files with 28 additions and 41 deletions
|
|
@ -55,7 +55,7 @@ class MediaSender @Inject constructor(
|
|||
suspend fun sendVoiceMessage(
|
||||
uri: Uri,
|
||||
mimeType: String,
|
||||
waveForm: List<Int>,
|
||||
waveForm: List<Float>,
|
||||
progressCallback: ProgressCallback? = null
|
||||
): Result<Unit> {
|
||||
return preProcessor
|
||||
|
|
|
|||
|
|
@ -29,6 +29,6 @@ sealed interface MediaUploadInfo {
|
|||
data class Image(override val file: File, val imageInfo: ImageInfo, val thumbnailFile: File) : MediaUploadInfo
|
||||
data class Video(override val file: File, val videoInfo: VideoInfo, val thumbnailFile: File) : MediaUploadInfo
|
||||
data class Audio(override val file: File, val audioInfo: AudioInfo) : MediaUploadInfo
|
||||
data class VoiceMessage(override val file: File, val audioInfo: AudioInfo, val waveform: List<Int>) : MediaUploadInfo
|
||||
data class VoiceMessage(override val file: File, val audioInfo: AudioInfo, val waveform: List<Float>) : MediaUploadInfo
|
||||
data class AnyFile(override val file: File, val fileInfo: FileInfo) : MediaUploadInfo
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue