Commit Graph

31 Commits (33617b0375104477071464ad2a782a5848f68f24)

Author SHA1 Message Date
Travis Ralston 14809dfda7 Misc cleanup 2021-04-22 08:22:31 -06:00
Travis Ralston b519d85127
Update src/voice/RecorderWorklet.ts to use sanity
Co-authored-by: Germain <germain@souquet.com>
2021-04-20 09:32:12 -06:00
Travis Ralston 4f75e2944c Appease the linter 2021-04-19 23:11:41 -06:00
Travis Ralston 61730f2f88 Populate waveform data on voice message event 2021-04-19 23:05:53 -06:00
Travis Ralston 7d9562137e Replace deprecated processor with a worklet 2021-04-19 21:54:08 -06:00
Travis Ralston 6f794cca9b Fill in some metadata for the sent event 2021-04-19 21:01:48 -06:00
Travis Ralston 22233a8745 Add a concept of a singleflight to avoid repeated calls to stop/ending
This makes it easier to keep track of which pieces the client will have already dispatched or been executed, reducing the amount of class members needed.

Critically, this makes it so the 'stop' button (which is currently a send button) actually works even after the automatic stop has happened.

UI is still pending for stopping recording early. This is not covered by this change.
2021-04-14 21:59:50 -06:00
Travis Ralston 0677cf866c Cap recording length, and warn at 10s remaining
See diff for details. Note that this introduces an "Uploading" state which is not currently used.

At the moment, if a user hits the maximum time then their recording will be broken. This is expected to be fixed in a future PR.
2021-04-14 21:15:06 -06:00
Travis Ralston b0a04c9f81 Rename VoiceRecorder -> VoiceRecording to better match expected function 2021-04-14 20:00:16 -06:00
Travis Ralston b15412056e It helps to use the right function 2021-03-30 12:08:11 -06:00
Travis Ralston 60326e359a Clarify comment 2021-03-30 12:01:35 -06:00
Travis Ralston 54412878a1 Merge branch 'develop' into travis/voice-messages/waveform 2021-03-29 22:59:51 -06:00
Travis Ralston 9c2d44805d Revert "Avoid use of deprecated APIs, instead using an AudioWorklet"
This reverts commit 5c685dcf35.
2021-03-29 22:57:59 -06:00
Travis Ralston 5c685dcf35 Avoid use of deprecated APIs, instead using an AudioWorklet
A bit annoying that it is async, but it'll do.
2021-03-29 21:59:31 -06:00
Travis Ralston e523ce6036 Fix float operations to make a little more sense. 2021-03-29 21:25:06 -06:00
Travis Ralston e31ad0e174 Don't specify sample rates for voice messages
Turns out the browser doesn't actually resample for us, instead opting to explode in sadness.

We'll leave the resampling to the opus encoder.

Fixes https://github.com/vector-im/element-web/issues/16775
2021-03-25 18:24:58 -06:00
Travis Ralston 101679f647 Adjust some settings 2021-03-25 17:30:44 -06:00
Travis Ralston 1419ac6b69 Hook up a clock and implement proper design 2021-03-25 17:12:26 -06:00
Travis Ralston 449e028bbd Actually use a waveform instead of the frequency data 2021-03-24 23:31:02 -06:00
Travis Ralston 8ddd14e252 Early concept for rendering the frequency waveform 2021-03-24 22:17:45 -06:00
Travis Ralston d929d48391 Clean up promises 2021-03-23 18:26:43 -06:00
Travis Ralston c9938ff704 Adjust settings/docs for encoder 2021-03-23 18:24:40 -06:00
Travis Ralston 090cf28af4 Appease the linter 2021-03-22 19:36:58 -06:00
Travis Ralston e352ed1908 Run audio through the Web Audio API instead
This leads to more reliable frequency/timing information, and involves a whole lot less decoding.

We still maintain ongoing encoded frames to avoid having to do one giant encode at the end, as that could take long enough to be disruptive.
2021-03-22 19:32:37 -06:00
Travis Ralston 207ba11da1 Tweak a bunch of settings 2021-03-19 17:08:01 -06:00
Travis Ralston 6c566cd382 Remove debugging 2021-03-16 23:50:03 -06:00
Travis Ralston 1dc2427128 Remove test function 2021-03-16 23:44:39 -06:00
Travis Ralston 9aa5348c7f Show a stop button to stop the recording 2021-03-16 23:43:59 -06:00
Travis Ralston dafa8786a1 Fix comments 2021-03-16 23:43:22 -06:00
Travis Ralston b5d32d92f3 Wire up a simple record button 2021-03-16 22:58:44 -06:00
Travis Ralston be2e30df0d Add an early voice recorder utility class 2021-03-16 22:58:44 -06:00