diff --git a/src/urh/plugins/NetworkSDRInterface/NetworkSDRInterfacePlugin.py b/src/urh/plugins/NetworkSDRInterface/NetworkSDRInterfacePlugin.py index 860e9dde5d..ef90517d06 100644 --- a/src/urh/plugins/NetworkSDRInterface/NetworkSDRInterfacePlugin.py +++ b/src/urh/plugins/NetworkSDRInterface/NetworkSDRInterfacePlugin.py @@ -73,7 +73,11 @@ def __init__(self, raw_mode=False, resume_on_full_receive_buffer=False, spectrum if self.raw_mode: num_samples = SettingsProxy.get_receive_buffer_size(self.resume_on_full_receive_buffer, self.is_in_spectrum_mode) - self.receive_buffer = np.zeros(int(num_samples), dtype=np.complex64, order='C') + try: + self.receive_buffer = np.zeros(num_samples, dtype=np.complex64, order='C') + except MemoryError: + logger.warning("Could not allocate buffer with {0:d} samples, trying less...") + self.receive_buffer = np.zeros(num_samples // 2, dtype=np.complex64, order='C') else: self.received_bits = []