File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -2934,15 +2934,15 @@ def wrsamp(
2934
2934
)
2935
2935
2936
2936
# If samps_per_frame is a list, check that it aligns as expected with the channels in the signal
2937
- if len (samps_per_frame ) > 1 :
2937
+ if isinstance (samps_per_frame , list ) :
2938
2938
# Get properties of the signal being passed
2939
- non_none_signal = next (signal for signal in signal_list if signal is not None )
2940
- if isinstance (non_none_signal , np .ndarray ):
2941
- num_sig_channels = non_none_signal .shape [1 ]
2942
- channel_samples = [non_none_signal .shape [0 ]] * non_none_signal .shape [1 ]
2943
- elif isinstance (non_none_signal , list ):
2944
- num_sig_channels = len (non_none_signal )
2945
- channel_samples = [len (channel ) for channel in non_none_signal ]
2939
+ first_valid_signal = next (signal for signal in signal_list if signal is not None )
2940
+ if isinstance (first_valid_signal , np .ndarray ):
2941
+ num_sig_channels = first_valid_signal .shape [1 ]
2942
+ channel_samples = [first_valid_signal .shape [0 ]] * first_valid_signal .shape [1 ]
2943
+ elif isinstance (first_valid_signal , list ):
2944
+ num_sig_channels = len (first_valid_signal )
2945
+ channel_samples = [len (channel ) for channel in first_valid_signal ]
2946
2946
else :
2947
2947
raise TypeError ("Unsupported signal format. Must be ndarray or list of lists." )
2948
2948
You can’t perform that action at this time.
0 commit comments