mirror of
https://github.com/HumanAIGC-Engineering/gradio-webrtc.git
synced 2026-02-05 18:09:23 +08:00
make code
This commit is contained in:
@@ -25,7 +25,6 @@
|
||||
});
|
||||
|
||||
function setupAudioContext() {
|
||||
console.log("set up")
|
||||
audioContext = new (window.AudioContext || window.webkitAudioContext)();
|
||||
analyser = audioContext.createAnalyser();
|
||||
console.log("audio_source", audio_source.srcObject);
|
||||
@@ -50,16 +49,6 @@
|
||||
|
||||
animationId = requestAnimationFrame(updateBars);
|
||||
}
|
||||
|
||||
function toggleMute() {
|
||||
if (audio_source && audio_source.srcObject) {
|
||||
const audioTracks = (audio_source.srcObject as MediaStream).getAudioTracks();
|
||||
audioTracks.forEach(track => {
|
||||
track.enabled = !track.enabled;
|
||||
});
|
||||
is_muted = !audioTracks[0].enabled;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
@@ -75,6 +64,8 @@
|
||||
<style>
|
||||
.waveContainer {
|
||||
position: relative;
|
||||
display: flex;
|
||||
min-height: 100px;
|
||||
max-height: 128px;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user