add private module to create model object for acoustics api
This commit is contained in:
1
opendbm/api_lib/verbal_acoustics/__init__.py
Normal file
1
opendbm/api_lib/verbal_acoustics/__init__.py
Normal file
@@ -0,0 +1 @@
|
|||||||
|
from opendbm.api_lib.verbal_acoustics.api import VerbalAcoustics
|
||||||
12
opendbm/api_lib/verbal_acoustics/_audio_intensity.py
Normal file
12
opendbm/api_lib/verbal_acoustics/_audio_intensity.py
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
from opendbm.api_lib.model import AudioModel
|
||||||
|
from opendbm.dbm_lib import run_intensity
|
||||||
|
|
||||||
|
|
||||||
|
class AudioIntensity(AudioModel):
|
||||||
|
def __init__(self):
|
||||||
|
super().__init__()
|
||||||
|
self._params = ["aco_int"]
|
||||||
|
|
||||||
|
@AudioModel.prep_func
|
||||||
|
def _fit_transform(self, path, **kwargs):
|
||||||
|
return run_intensity(path, ".", self.r_config, save=False)
|
||||||
14
opendbm/api_lib/verbal_acoustics/_formant_frequency.py
Normal file
14
opendbm/api_lib/verbal_acoustics/_formant_frequency.py
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
import pandas as pd
|
||||||
|
|
||||||
|
from opendbm.api_lib.model import AudioModel
|
||||||
|
from opendbm.dbm_lib import run_formant
|
||||||
|
|
||||||
|
|
||||||
|
class FormantFrequency(AudioModel):
|
||||||
|
def __init__(self):
|
||||||
|
super().__init__()
|
||||||
|
self._params = ["aco_fm1", "aco_fm2", "aco_fm3", "aco_fm4"]
|
||||||
|
|
||||||
|
@AudioModel.prep_func
|
||||||
|
def _fit_transform(self, path, **kwargs):
|
||||||
|
return run_formant(path, ".", self.r_config, save=False)
|
||||||
14
opendbm/api_lib/verbal_acoustics/_glottal_noise.py
Normal file
14
opendbm/api_lib/verbal_acoustics/_glottal_noise.py
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
import pandas as pd
|
||||||
|
|
||||||
|
from opendbm.api_lib.model import AudioModel
|
||||||
|
from opendbm.dbm_lib.dbm_features.raw_features.audio.gne import run_gne
|
||||||
|
|
||||||
|
|
||||||
|
class GlottalNoiseRatio(AudioModel):
|
||||||
|
def __init__(self):
|
||||||
|
super().__init__()
|
||||||
|
self._params = ["aco_gne"]
|
||||||
|
|
||||||
|
@AudioModel.prep_func
|
||||||
|
def _fit_transform(self, path, **kwargs):
|
||||||
|
return run_gne(path, ".", self.r_config, save=False, ff_df=kwargs["ff_df"])
|
||||||
14
opendbm/api_lib/verbal_acoustics/_harmonic_noise.py
Normal file
14
opendbm/api_lib/verbal_acoustics/_harmonic_noise.py
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
import pandas as pd
|
||||||
|
|
||||||
|
from opendbm.api_lib.model import AudioModel
|
||||||
|
from opendbm.dbm_lib.dbm_features.raw_features.audio.hnr import run_hnr
|
||||||
|
|
||||||
|
|
||||||
|
class HarmonicsNoiseRatio(AudioModel):
|
||||||
|
def __init__(self):
|
||||||
|
super().__init__()
|
||||||
|
self._params = ["aco_hnr"]
|
||||||
|
|
||||||
|
@AudioModel.prep_func
|
||||||
|
def _fit_transform(self, path, **kwargs):
|
||||||
|
return run_hnr(path, ".", self.r_config, save=False)
|
||||||
14
opendbm/api_lib/verbal_acoustics/_jitter.py
Normal file
14
opendbm/api_lib/verbal_acoustics/_jitter.py
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
import pandas as pd
|
||||||
|
|
||||||
|
from opendbm.api_lib.model import AudioModel
|
||||||
|
from opendbm.dbm_lib.dbm_features.raw_features.audio.jitter import run_jitter
|
||||||
|
|
||||||
|
|
||||||
|
class Jitter(AudioModel):
|
||||||
|
def __init__(self):
|
||||||
|
super().__init__()
|
||||||
|
self._params = ["aco_jitter"]
|
||||||
|
|
||||||
|
@AudioModel.prep_func
|
||||||
|
def _fit_transform(self, path, **kwargs):
|
||||||
|
return run_jitter(path, ".", self.r_config, save=False, ff_df=kwargs["ff_df"])
|
||||||
12
opendbm/api_lib/verbal_acoustics/_mfcc.py
Normal file
12
opendbm/api_lib/verbal_acoustics/_mfcc.py
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
from opendbm.api_lib.model import AudioModel
|
||||||
|
from opendbm.dbm_lib import run_mfcc
|
||||||
|
|
||||||
|
|
||||||
|
class MFCC(AudioModel):
|
||||||
|
def __init__(self):
|
||||||
|
super().__init__()
|
||||||
|
self._params = ["aco_mfcc" + str(i) for i in range(1, 13)]
|
||||||
|
|
||||||
|
@AudioModel.prep_func
|
||||||
|
def _fit_transform(self, path, **kwargs):
|
||||||
|
return run_mfcc(path, ".", self.r_config, save=False)
|
||||||
20
opendbm/api_lib/verbal_acoustics/_pause_characteristics.py
Normal file
20
opendbm/api_lib/verbal_acoustics/_pause_characteristics.py
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
import pandas as pd
|
||||||
|
|
||||||
|
from opendbm.api_lib.model import AudioModel
|
||||||
|
from opendbm.dbm_lib import run_pause_segment
|
||||||
|
|
||||||
|
|
||||||
|
class PauseCharacteristics(AudioModel):
|
||||||
|
def __init__(self):
|
||||||
|
super().__init__()
|
||||||
|
self._params = [
|
||||||
|
"aco_totaltime",
|
||||||
|
"aco_speakingtime",
|
||||||
|
"aco_numpauses",
|
||||||
|
"aco_pausetime",
|
||||||
|
"aco_pausefrac",
|
||||||
|
]
|
||||||
|
|
||||||
|
@AudioModel.prep_func
|
||||||
|
def _fit_transform(self, path, **kwargs):
|
||||||
|
return run_pause_segment(path, ".", self.r_config, save=False)
|
||||||
14
opendbm/api_lib/verbal_acoustics/_pitch_frequency.py
Normal file
14
opendbm/api_lib/verbal_acoustics/_pitch_frequency.py
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
import pandas as pd
|
||||||
|
|
||||||
|
from opendbm.api_lib.model import AudioModel
|
||||||
|
from opendbm.dbm_lib.dbm_features.raw_features.audio.pitch_freq import run_pitch
|
||||||
|
|
||||||
|
|
||||||
|
class PitchFrequency(AudioModel):
|
||||||
|
def __init__(self):
|
||||||
|
super().__init__()
|
||||||
|
self._params = ["aco_ff"]
|
||||||
|
|
||||||
|
@AudioModel.prep_func
|
||||||
|
def _fit_transform(self, path, **kwargs):
|
||||||
|
return run_pitch(path, ".", self.r_config, save=False)
|
||||||
14
opendbm/api_lib/verbal_acoustics/_shimmer.py
Normal file
14
opendbm/api_lib/verbal_acoustics/_shimmer.py
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
import pandas as pd
|
||||||
|
|
||||||
|
from opendbm.api_lib.model import AudioModel
|
||||||
|
from opendbm.dbm_lib.dbm_features.raw_features.audio.shimmer import run_shimmer
|
||||||
|
|
||||||
|
|
||||||
|
class Shimmer(AudioModel):
|
||||||
|
def __init__(self):
|
||||||
|
super().__init__()
|
||||||
|
self._params = ["aco_shimmer"]
|
||||||
|
|
||||||
|
@AudioModel.prep_func
|
||||||
|
def _fit_transform(self, path, **kwargs):
|
||||||
|
return run_shimmer(path, ".", self.r_config, save=False, ff_df=kwargs["ff_df"])
|
||||||
14
opendbm/api_lib/verbal_acoustics/_voice_prevalence.py
Normal file
14
opendbm/api_lib/verbal_acoustics/_voice_prevalence.py
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
import pandas as pd
|
||||||
|
|
||||||
|
from opendbm.api_lib.model import AudioModel
|
||||||
|
from opendbm.dbm_lib.dbm_features.raw_features.audio.voice_frame_score import run_vfs
|
||||||
|
|
||||||
|
|
||||||
|
class VoicePrevalence(AudioModel):
|
||||||
|
def __init__(self):
|
||||||
|
super().__init__()
|
||||||
|
self._params = ["aco_voiceframe", "aco_totvoiceframe", "aco_voicepct"]
|
||||||
|
|
||||||
|
@AudioModel.prep_func
|
||||||
|
def _fit_transform(self, path, **kwargs):
|
||||||
|
return run_vfs(path, ".", self.r_config, save=False)
|
||||||
Reference in New Issue
Block a user