switchMicrophone method

Future<void> switchMicrophone()

Switch microphone (rotate through available inputs)

Implementation

Future<void> switchMicrophone() async {
  final devices = await adapter.enumerateDevices();
  final inputs = devices.where((d) => d.kind == 'audioinput').toList();
  if (inputs.length < 2) return;

  // Find current input and switch to next
  // This requires re-initializing the local stream with the new deviceId
  // and replacing the track in the peer connection.
  // For now we just print for debugging as the adapter doesn't support track replacement yet.
  print('Switching microphone... Available: ${inputs.length}');
}