|
@@ -47,6 +47,9 @@ class LaughterFeatureExtractor(FeatureExtractor): |
|
|
|
|
|
|
|
|
See: https://github.com/jrgillick/laughter-detection for the laughter-detection library |
|
|
See: https://github.com/jrgillick/laughter-detection for the laughter-detection library |
|
|
""" |
|
|
""" |
|
|
|
|
|
_PREPEND_TIME = 7.0 # seconds before the laugh |
|
|
|
|
|
_APPEND_TIME = 3.0 # seconds after the laugh |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def __init__(self, input_files=None, config=None): |
|
|
def __init__(self, input_files=None, config=None): |
|
|
"""It is expected that input_files is a SourceMedia object""" |
|
|
"""It is expected that input_files is a SourceMedia object""" |
|
@@ -94,13 +97,10 @@ class LaughterFeatureExtractor(FeatureExtractor): |
|
|
TODO: config for length adjustments per design doc |
|
|
TODO: config for length adjustments per design doc |
|
|
TODO: play with numbers more to see what works best |
|
|
TODO: play with numbers more to see what works best |
|
|
""" |
|
|
""" |
|
|
PREPEND = 7.0 |
|
|
|
|
|
APPEND = 3.0 |
|
|
|
|
|
|
|
|
|
|
|
for feature in self.features: |
|
|
for feature in self.features: |
|
|
# do the pre & post adjustment |
|
|
# do the pre & post adjustment |
|
|
feature.interval.move_start(-PREPEND, relative=True) |
|
|
|
|
|
feature.interval.move_end(APPEND, relative=True) |
|
|
|
|
|
|
|
|
feature.interval.move_start(-self._PREPEND_TIME, relative=True) |
|
|
|
|
|
feature.interval.move_end(self._APPEND_TIME, relative=True) |
|
|
|
|
|
|
|
|
def setup(self): |
|
|
def setup(self): |
|
|
"""Setup the laughter feature extractor -- validate input files & config |
|
|
"""Setup the laughter feature extractor -- validate input files & config |
|
|