def test_dr2sr(self): r = dr2sr(65) self.assertEqual(round(r), 504) r = dr2sr(32) self.assertEqual(r, 1024.0) r = dr2sr(64) self.assertEqual(r, 512.0)
def receive(self, ser: BluetoothSerial) -> any: sr_val, _, n_ch, buf_size = ser.read_response(INQUIRY_RESPONSE, arg_format='<HIBB') channel_conf = ser.read(n_ch) sr = dr2sr(sr_val) ctypes = self.decode_channel_types(channel_conf) return sr, buf_size, ctypes
def sample_rate(self) -> float: return dr2sr(self._bin_reader.sample_rate)
def receive(self, ser: BluetoothSerial) -> None: sr_clock = ser.read_response(SAMPLING_RATE_RESPONSE, arg_format='<H') sr = dr2sr(sr_clock) return sr