VoiceMessages: properly respect user's microphone choice (#2602)
This commit is contained in:
parent
e9e789be70
commit
76f6912511
3 changed files with 6 additions and 0 deletions
|
@ -21,6 +21,7 @@ import { Button, showToast, Toasts, useState } from "@webpack/common";
|
||||||
|
|
||||||
import type { VoiceRecorder } from ".";
|
import type { VoiceRecorder } from ".";
|
||||||
import { settings } from "./settings";
|
import { settings } from "./settings";
|
||||||
|
import { MediaEngineStore } from "./utils";
|
||||||
|
|
||||||
const Native = VencordNative.pluginHelpers.VoiceMessages as PluginNative<typeof import("./native")>;
|
const Native = VencordNative.pluginHelpers.VoiceMessages as PluginNative<typeof import("./native")>;
|
||||||
|
|
||||||
|
@ -41,6 +42,7 @@ export const VoiceRecorderDesktop: VoiceRecorder = ({ setAudioBlob, onRecordingC
|
||||||
{
|
{
|
||||||
echoCancellation: settings.store.echoCancellation,
|
echoCancellation: settings.store.echoCancellation,
|
||||||
noiseCancellation: settings.store.noiseSuppression,
|
noiseCancellation: settings.store.noiseSuppression,
|
||||||
|
deviceId: MediaEngineStore.getInputDeviceId(),
|
||||||
},
|
},
|
||||||
(success: boolean) => {
|
(success: boolean) => {
|
||||||
if (success)
|
if (success)
|
||||||
|
|
|
@ -20,6 +20,7 @@ import { Button, useState } from "@webpack/common";
|
||||||
|
|
||||||
import type { VoiceRecorder } from ".";
|
import type { VoiceRecorder } from ".";
|
||||||
import { settings } from "./settings";
|
import { settings } from "./settings";
|
||||||
|
import { MediaEngineStore } from "./utils";
|
||||||
|
|
||||||
export const VoiceRecorderWeb: VoiceRecorder = ({ setAudioBlob, onRecordingChange }) => {
|
export const VoiceRecorderWeb: VoiceRecorder = ({ setAudioBlob, onRecordingChange }) => {
|
||||||
const [recording, setRecording] = useState(false);
|
const [recording, setRecording] = useState(false);
|
||||||
|
@ -40,6 +41,7 @@ export const VoiceRecorderWeb: VoiceRecorder = ({ setAudioBlob, onRecordingChang
|
||||||
audio: {
|
audio: {
|
||||||
echoCancellation: settings.store.echoCancellation,
|
echoCancellation: settings.store.echoCancellation,
|
||||||
noiseSuppression: settings.store.noiseSuppression,
|
noiseSuppression: settings.store.noiseSuppression,
|
||||||
|
deviceId: MediaEngineStore.getInputDeviceId()
|
||||||
}
|
}
|
||||||
}).then(stream => {
|
}).then(stream => {
|
||||||
const chunks = [] as Blob[];
|
const chunks = [] as Blob[];
|
||||||
|
|
|
@ -17,5 +17,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { classNameFactory } from "@api/Styles";
|
import { classNameFactory } from "@api/Styles";
|
||||||
|
import { findStoreLazy } from "@webpack";
|
||||||
|
|
||||||
|
export const MediaEngineStore = findStoreLazy("MediaEngineStore");
|
||||||
export const cl = classNameFactory("vc-vmsg-");
|
export const cl = classNameFactory("vc-vmsg-");
|
||||||
|
|
Loading…
Reference in a new issue