Hezu06 commited on
Commit
f000e98
·
1 Parent(s): 80f1340

refactor websocket connection handling for clarity and consistency

Browse files
Files changed (1) hide show
  1. index.html +1 -2
index.html CHANGED
@@ -245,6 +245,7 @@
245
  let bpmHistory = [];
246
  let currentAudio = null;
247
  let debugVisible = false;
 
248
 
249
  const bpmDisplay = document.getElementById('bpm-display');
250
  const statusEl = document.getElementById('status');
@@ -492,8 +493,6 @@
492
  log("🎹 Đã khởi tạo Lo-fi Synthesizer (Có Limiter chống rè).");
493
  setStatus("Sẵn sàng sinh nhạc AI", "ok");
494
 
495
- let ws = null; // Biến giữ kết nối WebSocket
496
-
497
  // ===============================
498
  // GENERATE MUSIC (CẬP NHẬT WEBSOCKET)
499
  // ===============================
 
245
  let bpmHistory = [];
246
  let currentAudio = null;
247
  let debugVisible = false;
248
+ let ws = null; // Biến giữ kết nối WebSocket
249
 
250
  const bpmDisplay = document.getElementById('bpm-display');
251
  const statusEl = document.getElementById('status');
 
493
  log("🎹 Đã khởi tạo Lo-fi Synthesizer (Có Limiter chống rè).");
494
  setStatus("Sẵn sàng sinh nhạc AI", "ok");
495
 
 
 
496
  // ===============================
497
  // GENERATE MUSIC (CẬP NHẬT WEBSOCKET)
498
  // ===============================