How to keyframe the volume of a speaker with python
Volume is a data property, not an object property.
Don't use:
obj.keyframe_insert(&quot;volume&quot;)

But use:
obj.data.keyframe_insert(&quot;volume&quot;)