Serializing output of metadata in audio_metadata

I have been having some trouble exporting metadata from multiple files. Is there a suggested way to do that? The string output is very readable, but it doesn’t seem to serialize easily, unless I am missing something (which is quite likely).

The problem in serializing the metadata I have encountered (just with wave) is with the class declarations. Maybe another function would be useful, sending it out as a dictionary that can be converted to JSON, YAML, etc. Maybe as a dictionary of class to value? Or adding a “class” field?

It has to do with the classes being subclasses of collections.MutableMapping and the encoders for those formats not supporting them. Usually, their default encoders will only support the builtin dict class. The json library, for example, allows you to subclass JSONEncoder and pass that along to the function calls.

I don’t want it in the library itself; this is a separate problem that should be solved in a separate place. I have no interest in this functionality myself, so I wouldn’t count on me implementing it.