From 18ae6d4db7097abb9637ca4d2c657891556190cc Mon Sep 17 00:00:00 2001 From: Frost-ZX Date: Thu, 12 Feb 2026 14:22:15 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E8=B0=83=E6=95=B4=E4=B8=B2=E5=8F=A3?= =?UTF-8?q?=E8=BF=9E=E6=8E=A5=E5=8F=82=E6=95=B0=E5=92=8C=E9=9F=B3=E9=A2=91?= =?UTF-8?q?=E5=88=86=E6=9E=90=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/main.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/assets/main.js b/assets/main.js index f0ef5fb..2884b73 100644 --- a/assets/main.js +++ b/assets/main.js @@ -201,6 +201,7 @@ window.addEventListener('DOMContentLoaded', () => { // 创建分析器 analyser = audioContext.createAnalyser(); analyser.fftSize = 256; + analyser.smoothingTimeConstant = 0.25; // 连接麦克风到分析器 microphone.connect(analyser); @@ -335,13 +336,13 @@ window.addEventListener('DOMContentLoaded', () => { // 请求用户授权访问串口设备 port = await navigator.serial.requestPort(); - // 打开串口,设置波特率为 19200(与 Python 脚本一致) + // 打开串口 await port.open({ - baudRate: 19200, + baudRate: 115200, dataBits: 8, stopBits: 1, parity: 'none', - flowControl: 'none' + flowControl: 'hardware', }); // 获取读写器