cduss Claude Opus 4.5 commited on
Commit
f7818b6
·
1 Parent(s): 1588d39

Add debug logging for mic/audio troubleshooting

Browse files

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

Files changed (1) hide show
  1. index.html +15 -1
index.html CHANGED
@@ -1166,7 +1166,21 @@
1166
  localStream = await navigator.mediaDevices.getUserMedia({
1167
  audio: { echoCancellation: true, noiseSuppression: true, autoGainControl: true }
1168
  });
1169
- if (audioSender) await audioSender.replaceTrack(localStream.getAudioTracks()[0]);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1170
  micEnabled = true;
1171
  btn.textContent = 'Disable Mic';
1172
  btn.classList.remove('btn-primary');
 
1166
  localStream = await navigator.mediaDevices.getUserMedia({
1167
  audio: { echoCancellation: true, noiseSuppression: true, autoGainControl: true }
1168
  });
1169
+ console.log('Got mic stream:', localStream.getAudioTracks()[0].label);
1170
+ console.log('audioSender exists:', !!audioSender);
1171
+ if (audioSender) {
1172
+ await audioSender.replaceTrack(localStream.getAudioTracks()[0]);
1173
+ console.log('Track replaced on sender');
1174
+ // Log connection state
1175
+ console.log('PeerConnection state:', peerConnection?.connectionState);
1176
+ console.log('ICE state:', peerConnection?.iceConnectionState);
1177
+ // Log all transceivers
1178
+ peerConnection?.getTransceivers().forEach((t, i) => {
1179
+ console.log(`Transceiver ${i}: kind=${t.receiver.track?.kind}, direction=${t.direction}, currentDirection=${t.currentDirection}`);
1180
+ });
1181
+ } else {
1182
+ console.error('No audioSender available!');
1183
+ }
1184
  micEnabled = true;
1185
  btn.textContent = 'Disable Mic';
1186
  btn.classList.remove('btn-primary');