File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -288,7 +288,19 @@ def _run_with_sync(original_cmd, suppress_output=False):
288288 return process
289289
290290
291- _RATE_PATTERN = re .compile (r'^(\d+(?:\.\d+)?)(hz|khz|k)?$' , re .IGNORECASE )
291+ _RATE_PATTERN = re .compile (r'''
292+ ^ # Start of string
293+ ( # Group 1: The numeric value
294+ \d+ # One or more digits (integer part)
295+ (?:\.\d+)? # Optional: decimal point followed by digits
296+ ) # Examples: "10", "0.5", "100.25"
297+ ( # Group 2: Optional unit suffix
298+ hz # "hz" - hertz
299+ | khz # "khz" - kilohertz
300+ | k # "k" - shorthand for kilohertz
301+ )? # Suffix is optional (bare number = Hz)
302+ $ # End of string
303+ ''' , re .VERBOSE | re .IGNORECASE )
292304
293305
294306def _parse_sampling_rate (rate_str : str ) -> int :
You can’t perform that action at this time.
0 commit comments