parent
e954433289
commit
4d1bea502a
4 changed files with 0 additions and 69 deletions
|
|
@ -118,7 +118,6 @@ const el = {
|
|||
vcChannelName: document.getElementById("vc-channel-name"),
|
||||
voiceVideoBtn: document.getElementById("voice-video-btn"),
|
||||
voiceScreenBtn: document.getElementById("voice-screen-btn"),
|
||||
voiceFilterBtn: document.getElementById("voice-filter-btn"),
|
||||
voiceMuteBtn: document.getElementById("voice-mute-btn"),
|
||||
voiceLeaveBtn: document.getElementById("voice-leave-btn"),
|
||||
videoGrid: document.getElementById("video-grid"),
|
||||
|
|
@ -725,7 +724,6 @@ function stopAndClearAudioPipeline() {
|
|||
state.voice.rawStream = null;
|
||||
state.voice.audioContext = null;
|
||||
state.voice.activeNoiseFilter = 'off';
|
||||
updateVoiceFilterButton();
|
||||
}
|
||||
|
||||
function stopAndClearVideoPipeline() {
|
||||
|
|
@ -819,8 +817,6 @@ async function buildAudioPipeline(rawStream) {
|
|||
state.voice.activeNoiseFilter = 'off';
|
||||
}
|
||||
}
|
||||
updateVoiceFilterButton();
|
||||
|
||||
// Metering/Speaking detection
|
||||
const analyser = ctx.createAnalyser();
|
||||
analyser.fftSize = 512;
|
||||
|
|
@ -885,34 +881,6 @@ async function getDeepFilterModule() {
|
|||
return state.voice.deepFilterModule;
|
||||
}
|
||||
|
||||
function updateVoiceFilterButton() {
|
||||
if (!el.voiceFilterBtn) return;
|
||||
const requestedMode = state.voice.noiseFilterMode === 'deepfilter' ? 'DeepFilterNet3' : 'Off';
|
||||
const activeMode = state.voice.activeNoiseFilter === 'deepfilter' ? 'DeepFilterNet3' : 'Off';
|
||||
const activeSuffix = requestedMode === activeMode ? '' : ` (active: ${activeMode})`;
|
||||
el.voiceFilterBtn.title = `Noise Filter: ${requestedMode}${activeSuffix}`;
|
||||
el.voiceFilterBtn.innerHTML = state.voice.noiseFilterMode === 'deepfilter'
|
||||
? '<i data-lucide="filter"></i>'
|
||||
: '<i data-lucide="filter-x"></i>';
|
||||
el.voiceFilterBtn.style.color = state.voice.noiseFilterMode === 'deepfilter'
|
||||
? 'var(--green)'
|
||||
: 'var(--text-muted)';
|
||||
lucide.createIcons();
|
||||
}
|
||||
|
||||
async function toggleNoiseFilter() {
|
||||
state.voice.noiseFilterMode = state.voice.noiseFilterMode === 'deepfilter' ? 'off' : 'deepfilter';
|
||||
updateVoiceFilterButton();
|
||||
if (!state.voice.joinedChannelId) return;
|
||||
|
||||
try {
|
||||
await leaveVoice();
|
||||
await joinVoice();
|
||||
} catch (err) {
|
||||
console.error("failed to rejoin voice after filter change", err);
|
||||
}
|
||||
}
|
||||
|
||||
async function createLocalVoiceStream() {
|
||||
const useDeepFilter = state.voice.noiseFilterMode === 'deepfilter';
|
||||
const constraints = {
|
||||
|
|
@ -1532,10 +1500,8 @@ async function init() {
|
|||
|
||||
el.voiceVideoBtn.onclick = toggleVideo;
|
||||
el.voiceScreenBtn.onclick = toggleScreenShare;
|
||||
if (el.voiceFilterBtn) el.voiceFilterBtn.onclick = toggleNoiseFilter;
|
||||
el.voiceMuteBtn.onclick = toggleMute;
|
||||
el.voiceLeaveBtn.onclick = leaveVoice;
|
||||
updateVoiceFilterButton();
|
||||
|
||||
el.addSoundBtn.onclick = () => {
|
||||
el.soundModal.classList.remove("hidden");
|
||||
|
|
|
|||
|
|
@ -91,7 +91,6 @@
|
|||
<div class="vc-actions">
|
||||
<button id="voice-video-btn" title="Turn on Camera"><i data-lucide="video-off"></i></button>
|
||||
<button id="voice-screen-btn" title="Share Screen"><i data-lucide="monitor-off"></i></button>
|
||||
<button id="voice-filter-btn" title="Noise Filter"><i data-lucide="filter"></i></button>
|
||||
<button id="voice-mute-btn" title="Mute"><i data-lucide="mic"></i></button>
|
||||
<button id="voice-leave-btn" title="Disconnect"><i data-lucide="phone-off"></i></button>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue