diff options
Diffstat (limited to 'soxdial')
-rwxr-xr-x | soxdial | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -425,18 +425,24 @@ sub make_sox_cmd { # support either seconds (possibly with decimal point, e.g. 0.5) or # milliseconds (e.g. 500ms). sub parse_sec { + no warnings "numeric"; $_ = shift || 0; if(/^(.+)ms$/) { $_ = $1 / 1000; + } else { + $_ += 0; } return $_; } # support either Hz (e.g. 8000) or KHz (e.g. 8k or 8K). sub parse_rate { + no warnings "numeric"; $_ = shift || 0; if(/^(.+)k$/i) { $_ = $1 * 1000; + } else { + $_ += 0; } return $_; } |