From 6bd2ef5b3453d9aae4ff429fd45afc0bcc026198 Mon Sep 17 00:00:00 2001 From: Sumner Evans Date: Tue, 25 Jun 2024 11:02:55 -0600 Subject: [PATCH] media: decode waveform TG -> Matrix Signed-off-by: Sumner Evans --- pkg/connector/msgconv/tomatrix.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/connector/msgconv/tomatrix.go b/pkg/connector/msgconv/tomatrix.go index 64a312e0..4ab2f157 100644 --- a/pkg/connector/msgconv/tomatrix.go +++ b/pkg/connector/msgconv/tomatrix.go @@ -19,6 +19,7 @@ import ( "go.mau.fi/mautrix-telegram/pkg/connector/download" "go.mau.fi/mautrix-telegram/pkg/connector/ids" "go.mau.fi/mautrix-telegram/pkg/connector/util" + "go.mau.fi/mautrix-telegram/pkg/connector/waveform" ) type spoilable interface { @@ -191,8 +192,8 @@ func (mc *MessageConverter) convertMediaRequiringUpload(ctx context.Context, por audio = &event.MSC1767Audio{ Duration: a.Duration * 1000, } - if waveform, ok := a.GetWaveform(); ok { - for _, v := range waveform { + if wf, ok := a.GetWaveform(); ok { + for _, v := range waveform.Decode(wf) { audio.Waveform = append(audio.Waveform, int(v)<<5) } }