我想在XSLT的import numpy as np
def main_loop():
stream = <create stream with your audio library>
while True:
sample = stream.readframes(<define number of samples / time to read>)
print(is_speech(sample))
def is_speech(sample):
audio = np.array(sample)
< do you processing >
# e.g. simple loudness test
return np.any(audio > 0.8):
条件中使用多个or
条件。
我使用的代码:
If
使用上面的代码时,出现错误。我该如何解决?
答案 0 :(得分:1)
如果要比较序列,请使用=
运算符,而不要使用eq
。因此,假设您使用XSLT 2或处理器,则使用$var = ('xxx','yyy','zzz','mmm')
的语法应该可以使用。使用XSLT 1处理器时,根本不支持构造字符串序列的右侧表达式,因为数据类型存在原始值和节点集以及(在XSLT中)结果树片段,但通常不包含字符串序列或类型。 / p>