Mercurial > hg > auditok
changeset 183:c1397190e35e
Rename strict_min_length as strict_min_dur
author | Amine Sehili <amine.sehili@gmail.com> |
---|---|
date | Thu, 28 Mar 2019 21:02:10 +0100 |
parents | c07f1620e5b0 |
children | de766e047fd2 |
files | auditok/cmdline_util.py auditok/core.py |
diffstat | 2 files changed, 6 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/auditok/cmdline_util.py Wed Mar 27 20:43:19 2019 +0100 +++ b/auditok/cmdline_util.py Thu Mar 28 21:02:10 2019 +0100 @@ -15,7 +15,7 @@ "max_dur": args_namespace.max_duration, "max_silence": args_namespace.max_silence, "drop_trailing_silence": args_namespace.drop_trailing_silence, - "strict_min_length": args_namespace.strict_min_length, + "strict_min_dur": args_namespace.strict_min_duration, "energy_threshold": args_namespace.energy_threshold, "max_read_time": args_namespace.max_time, "analysis_window": args_namespace.analysis_window,
--- a/auditok/core.py Wed Mar 27 20:43:19 2019 +0100 +++ b/auditok/core.py Thu Mar 28 21:02:10 2019 +0100 @@ -25,7 +25,7 @@ max_dur=5, max_silence=0.3, drop_trailing_silence=False, - strict_min_length=False, + strict_min_dur=False, analysis_window=0.01, **kwargs ): @@ -54,10 +54,10 @@ might be many silent gaps of this duration within an audio event. drop_trailing_silence: bool drop trailing silence from detected events - strict_min_length: bool - strict minimum length. Drop an event if it is shorter than ´min_length´ + strict_min_dur: bool + strict minimum duration. Drop an event if it is shorter than ´min_dur´ even if it is continguous to the latest valid event. This happens if - the the latest event had reached ´max_length´. + the the latest event had reached ´max_dur´. analysis_window: float duration of analysis window in seconds. Default: 0.05 second (50 ms). A value up to 0.1 second (100 ms) should be good for most use-cases. @@ -114,7 +114,7 @@ validator = AudioEnergyValidator(source.sw, energy_threshold) mode = StreamTokenizer.DROP_TRAILING_SILENCE if drop_trailing_silence else 0 - if strict_min_length: + if strict_min_dur: mode |= StreamTokenizer.STRICT_MIN_LENGTH min_length = _duration_to_nb_windows(min_dur, analysis_window)