Error in recording.py if chunk_size is greater than number of frames in recording
Getting an error in `spikeinterace/core/recording.py` setting up a unit test for a small recording because the number of frames is less than the chunk size. In lines 36-38:

```
        length = recording.get_num_frames(segment_index)
        random_starts = np.random.RandomState(seed=seed).randint(0,
                                                                 length - chunk_size, size=num_chunks_per_segment)
```
if `length <=chunk_size`, then an error is thrown.
diff --git a/spikeinterface/core/recording_tools.py b/spikeinterface/core/recording_tools.py
index 65a21a6d..93eaed0f 100644
--- a/spikeinterface/core/recording_tools.py
+++ b/spikeinterface/core/recording_tools.py
@@ -27,15 +27,20 @@ def get_random_data_chunks(recording, return_scaled=False, num_chunks_per_segmen
     chunk_list: np.array
         Array of concatenate chunks per segment
     """
-    # TODO: if segment have differents length make another sampling that dependant on the lneght of the segment
-    # Should be done by chnaging kwargs with total_num_chunks=XXX and total_duration=YYYY
-    # And randomize the number of chunk per segment wieighted by segment duration
+    # TODO: if segment have differents length make another sampling that dependant on the length of the segment
+    # Should be done by changing kwargs with total_num_chunks=XXX and total_duration=YYYY
+    # And randomize the number of chunk per segment weighted by segment duration
+
+    # check chunk size    
+    for segment_index in range(recording.get_num_segments()):
+        assert chunk_size < recording.get_num_samples(segment_index), (f"chunk_size is greater than the number "
+                                                                        f"of samples for segment index {segment_index}. "
+                                                                        f"Use a smaller chunk_size!")
 
     chunk_list = []
     for segment_index in range(recording.get_num_segments()):
         length = recording.get_num_frames(segment_index)
-        random_starts = np.random.RandomState(seed=seed).randint(0,
-                                                                 length - chunk_size, size=num_chunks_per_segment)
+        random_starts = np.random.RandomState(seed=seed).randint(0, length - chunk_size, size=num_chunks_per_segment)
         for start_frame in random_starts:
             chunk = recording.get_traces(start_frame=start_frame,
                                          end_frame=start_frame + chunk_size,
['spikeinterface/core/recording_tools.py']