mirror of
https://github.com/element-hq/element-web
synced 2024-11-26 11:15:53 +03:00
It helps to use the right function
This commit is contained in:
parent
60326e359a
commit
b15412056e
1 changed files with 2 additions and 2 deletions
|
@ -19,7 +19,7 @@ import encoderPath from 'opus-recorder/dist/encoderWorker.min.js';
|
|||
import {MatrixClient} from "matrix-js-sdk/src/client";
|
||||
import CallMediaHandler from "../CallMediaHandler";
|
||||
import {SimpleObservable} from "matrix-widget-api";
|
||||
import {percentageOf} from "../utils/numbers";
|
||||
import {clamp} from "../utils/numbers";
|
||||
|
||||
const CHANNELS = 1; // stereo isn't important
|
||||
const SAMPLE_RATE = 48000; // 48khz is what WebRTC uses. 12khz is where we lose quality.
|
||||
|
@ -143,7 +143,7 @@ export class VoiceRecorder {
|
|||
// We're clamping the values so we can do that math operation mentioned above,
|
||||
// and to ensure that we produce consistent data (it's possible for the array
|
||||
// to exceed the specified range with some audio input devices).
|
||||
translatedData.push(percentageOf(data[i], 0, 1));
|
||||
translatedData.push(clamp(data[i], 0, 1));
|
||||
}
|
||||
|
||||
this.observable.update({
|
||||
|
|
Loading…
Reference in a new issue