Skip to content

Conversation

turt2live
Copy link
Member

Rendered

See #3245 for implementations (Element Web/Desktop, currently).

@turt2live turt2live added proposal A matrix spec change proposal client-server Client-Server API kind:feature MSC for not-core and not-maintenance stuff labels Jun 15, 2021
@turt2live turt2live changed the title [WIP] MSC3246: Audio event/waveform representation in extensible events MSC3246: Audio waveform for extensible events Nov 13, 2022
@turt2live
Copy link
Member Author

Note that this has now been rescoped to just waveforms, with @uhoreg's comment about range being unresolved at the moment.

@turt2live turt2live marked this pull request as ready for review November 14, 2022 21:38
julioromano pushed a commit to element-hq/element-x-android that referenced this pull request Oct 27, 2023
[MSC3246](matrix-org/matrix-spec-proposals#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.
Comment on lines +12 to +16
Under the `m.audio_details` content block, a new optional field named `waveform` is added. It is
an array of (non-floating) numbers to represent the amplitude of the audio over time. Because
floating point numbers are not allowed in Matrix events, integers should be between 0 and 256,
inclusive. Though there is no limit to the number of entries in the array, senders should aim to
have at least 30 and not more than 120.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe that the way that the waveform is computed should be specced, otherwise different clients might generate different waveforms for the same audio file, which defeats the purpose of this field.

This is already the case with Element Web and Element X Android that generate waveforms with very different values.


Under the `m.audio_details` content block, a new optional field named `waveform` is added. It is
an array of (non-floating) numbers to represent the amplitude of the audio over time. Because
floating point numbers are not allowed in Matrix events, integers should be between 0 and 256,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this the unsigned 8-bit integer PCM sample format?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

client-server Client-Server API kind:feature MSC for not-core and not-maintenance stuff proposal A matrix spec change proposal

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants