diff --git a/xvf3800.py b/xvf3800.py index 1589952..707fb20 100644 --- a/xvf3800.py +++ b/xvf3800.py @@ -103,30 +103,28 @@ class XVF3800: def read_doa(self) -> tuple[int, bool]: """Read Direction of Arrival using the auto-select beam azimuth. Returns (angle 0-359 degrees, vad True/False). - Uses AUDIO_MGR_SELECTED_AZIMUTHS which tracks the active speaker.""" + + Uses AUDIO_MGR_SELECTED_AZIMUTHS which returns two values: + [0] processed_doa — NaN when no speech, real angle when speech detected (= VAD) + [1] auto_select_doa — always tracks strongest source, even noise (= angle) + """ import math - # Read auto-select beam azimuth (2 floats: processed_doa, auto_select_doa) data = self._read_float(AUDIO_MGR_RESID, AUDIO_MGR_SELECTED_AZ_CMD, 2) if len(data) < 9: # 1 status + 2*4 bytes return 0, False processed_doa, auto_select_doa = struct.unpack_from("= 5: - angle, vad_flag = struct.unpack_from("