Python Vamp插件JSON编码器

Python Vamp插件JSON编码器,python,json,Python,Json,我在Python中使用的是: 我必须在json对象中解码结果。由于Vamp插件使用特定对象vampy.RealTime对象包装数字,因此我为此编写了一个Encoder,否则您将得到一个TypeError:(integer)不是JSON序列化的-有关此特定错误,请参见此处: 因此,我编写了一个自定义JSON编码器,它使用vampy.RealTime对象中的数字转换,该对象取自 但当我像这样运行它时 json.dumps(chroma, sort_keys=True, indent=4, cls=V

我在Python中使用的是:

我必须在json对象中解码结果。由于Vamp插件使用特定对象
vampy.RealTime
对象包装数字,因此我为此编写了一个
Encoder
,否则您将得到一个
TypeError:(integer)不是JSON序列化的
-有关此特定错误,请参见此处:

因此,我编写了一个自定义JSON编码器,它使用
vampy.RealTime
对象中的数字转换,该对象取自

但当我像这样运行它时

json.dumps(chroma, sort_keys=True, indent=4, cls=VampJSONEncoder)
我得到一份工作

RuntimeError: maximum recursion depth exceeded while calling a Python object
json.dumps(chroma, sort_keys=True, indent=4, cls=VampJSONEncoder)
RuntimeError: maximum recursion depth exceeded while calling a Python object