我在尝试在 python 中集成一些 VAD 检测时遇到了一些问题(使用 R)
我试过创建自己的配置文件,但我没有在这方面取得任何进展。
这是一个配置文件的尝试实现
config_str = '''
[componentInstances:cComponentManager]
instance[vad].type=cVadV1
;;; default source
[componentInstances:cComponentManager]
instance[VadV1].type=cVadV1
;;; source
\{\cm[source{?}:include external source]}
;;; main section
[componentInstances:cComponentManager]
instance[lld].type = cEnergy
instance[lpc].type = cLpc
instance[melspec].type= cMelspec
instance[lsp].type = cLsp
instance[vad].type = cVadV1
[lld:cEnergy]
reader.dmLevel=frame
writer.dmLevel=energy
nameAppend=energy
rms=1
logs=1
[lpc:cLpc]
eader.dmLevel=frames
saveRefCoeff=0
writer.dmLevel=lpc
p=10
[mspecV:cMelspec]
reader.dmLevel=fftmagnitude
writer.dmLevel=mspec
htkcompatible = 0
usePower = 0
nBands = 14
lofreq = 50
hifreq = 4000
[lsp:cLsp]
reader.dmLevel=lpc
writer.dmLevel=lsp
[vad:cVadv1]
reader.dmLevel=mspec;lsp;energy
writer.dmLevel=vad11
writer.levelconf.noHang=1
debug=\cm[vaddebug{0}:1=debug vad]
threshold=\cm[threshold{-13}:VAD threshold]
disableDynamicVAD=\cm[disableDynamicVAD{0}:disable dynamic threshold vad, instead use energy based vad only, the energy threshold can be set via the 'threshold' option]
;threshold=\cm[threshold{-13.0}:
;;; sink
\{\cm[sink{?}:include external sink]}
然后我尝试打开配置文件并运行一些处理
with open('my.conf', 'w') as fp:
fp.write(config_str)
smile = opensmile.Smile(
feature_set='my.conf',
feature_level='vad',
)
test6 = smile.process_signal(
signal,
sampling_rate