I'm having trouble creating a diff through the system ("Unhandled Exception ("AphrontQueryException") #1048: Column 'filename' cannot be null"), so I've attached it here. Sorry.
The changes here are driven by my own needs for this functionality in Blender, and are an extension of the existing functionality, mostly for time savings reasons. Tested on 2.79b on Windows.
- Support unlimited sound strips
- Improved strip position validation
- Explicit error feedback so users can identify exact problem spots
- Re-running the script with the same strips selected may have resulted in one of the curves being flattened to zero (which one depended on the current frame). I determined this was a result of using context.scene.frame_current instead of context.scene.frame_set(), and a simple replacement fixed the issue.
- Handled the case where the strip on the right side of the transition already had a keyframe set on the volume property. Previously, this resulted in an incorrect keyframe value being set on that strip due to an unexpected intermediate keyframe state.