mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-21 20:37:02 -04:00
fix things using lodash (#1882)
This commit is contained in:
parent
9c13befcb6
commit
c7a20769f9
4 changed files with 8 additions and 6 deletions
|
@ -26,7 +26,7 @@ import { useAwaiter } from "@utils/react";
|
|||
import definePlugin from "@utils/types";
|
||||
import { chooseFile } from "@utils/web";
|
||||
import { findByPropsLazy, findLazy, findStoreLazy } from "@webpack";
|
||||
import { Button, FluxDispatcher, Forms, Menu, PermissionsBits, PermissionStore, RestAPI, SelectedChannelStore, showToast, SnowflakeUtils, Toasts, useEffect, useState } from "@webpack/common";
|
||||
import { Button, FluxDispatcher, Forms, lodash, Menu, PermissionsBits, PermissionStore, RestAPI, SelectedChannelStore, showToast, SnowflakeUtils, Toasts, useEffect, useState } from "@webpack/common";
|
||||
import { ComponentType } from "react";
|
||||
|
||||
import { VoiceRecorderDesktop } from "./DesktopRecorder";
|
||||
|
@ -138,7 +138,7 @@ function Modal({ modalProps }: { modalProps: ModalProps; }) {
|
|||
const channelData = audioBuffer.getChannelData(0);
|
||||
|
||||
// average the samples into much lower resolution bins, maximum of 256 total bins
|
||||
const bins = new Uint8Array(window._.clamp(Math.floor(audioBuffer.duration * 10), Math.min(32, channelData.length), 256));
|
||||
const bins = new Uint8Array(lodash.clamp(Math.floor(audioBuffer.duration * 10), Math.min(32, channelData.length), 256));
|
||||
const samplesPerBin = Math.floor(channelData.length / bins.length);
|
||||
|
||||
// Get root mean square of each bin
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue