- New `AudioLevelCalculator` that outputs dB0v rescaled to the [0;1] range.
- `VoiceRecorder` now stores the audio levels sampled while recording, then resamples them to 100 samples to use as waveform preview.
- Waveform data is carried all the way as a `List<Float>` and converted to `List<Int>` in the [0;1024] range as per matrix spec only before sending it.
* Update the chat screen UI using `RoomInfo`.
This is specially useful for getting live values for `hasRoomCall`.
* Ensure the first `MatrixRoomInfo` is emitted ASAP
* Try excluding `*Present$present$*` inner functions from kover as separate entities
* Update strings
---------
Co-authored-by: ElementBot <benoitm+elementbot@element.io>
This is in preparation of further changes to the way the audio level is computed and to allow recording and sending of the waveform. The main reasoning behind the change is twofold:
1) We don't need the precision of Double in our context (we just need a rough indication of the changes in audio level to successfully draw a level meter or a waveform in our UI).
2) Performance: It is true that on 64 bit CPUs single operations involving Floats or Doubles take the same amount of time (i.e one clock cycle). But there are other aspects here that vouch in favor of Floats:
- A float takes half the space in memory compared to a double, so when storing long lists of them this can add up.
- On Android O and greater the ART runtime can "vectorize" certain operations on lists and make use of the CPU's SIMD registers which are generally 128 bits. So by using floats 4 of them can fit and be computed at the same time whilst with doubles only 2 will fit halving the throughput.
References:
- https://source.android.com/docs/core/runtime/improvements
- https://www.slideshare.net/linaroorg/automatic-vectorization-in-art-android-runtime-sfo17216
* Update dependency org.matrix.rustcomponents:sdk-android to v0.1.63
* Update Element Call integrated APIs
* Take into account the new `MessageType.Other` from the SDK
---------
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Jorge Martín <jorgem@element.io>
Co-authored-by: Benoit Marty <benoit@matrix.org>
* Integrate Element Call with widget API.
- Add `appconfig` module and extract constants that can be overridden in forks there.
- Add an Element Call feature flag, disabled by default.
- Refactor the whole `ElementCallActivity`, move most logic out of it.
- Integrate with the Rust Widget Driver API (note the Rust SDK version used in this PR lacks some needed changes to make the calls actually work).
- Handle calls differently based on `CallType`.
- Add UI to create/join a call.
---------
Co-authored-by: ElementBot <benoitm+elementbot@element.io>
## Type of change
- [ ] Feature
- [ ] Bugfix
- [x] Technical
- [ ] Other :
## Content
Dagger now provides the app's `cacheDir` when requesting a `@CacheDirectory File` type.
## Motivation and context
To support some upcoming code that needs the `cacheDir` to be changed during tests.
`TimelineItemAudioContent`:
- Use `java.time.Duration` instead of milliseconds. This will ease up things in the future because currently milliseconds are sent over the wire but in the future seconds will be sent (as per the stable MSC). Using `Duration` will allow our downstream code to be independent of what's passed over the wire.
- Rename `audioSource` property to `mediaSource` to better match its type.
`AudioMessageType`:
- Add and populate new fields `details` and `isVoiceMessage` to be used by voice messages.
## Type of change
- [ ] Feature
- [ ] Bugfix
- [x] Technical
- [ ] Other :
## Content
Includes the `coreLibraryDesugaring(libs.android.desugar)` dependency in all modules which use one of our gradle plugins.
## Motivation and context
Right now desugaring is enabled also in library modules but the desugar dependency is not included in those.
This causes some unwanted side effects such as being unable to run compose previews in an emu.
This change will also include the desugar dependency in those libraries.