Skip to content

Instantly share code, notes, and snippets.

@Pullusb
Created August 12, 2016 15:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Pullusb/c1a82f79bd3a47e77d1c9d53721975e5 to your computer and use it in GitHub Desktop.
Save Pullusb/c1a82f79bd3a47e77d1c9d53721975e5 to your computer and use it in GitHub Desktop.
blender script - export sound for each selected strip in VSE
import bpy
import os
C = bpy.context
scn = C.scene
dest_folder = os.path.dirname(scn.render.filepath)
if not os.path.exists(dest_folder):
print ("ERROR, destination folder must exist:\n", dest_folder, "not found")
else:
count = 0
for s in scn.sequence_editor.sequences:
if s.select:
count += 1
scn.frame_start = s.frame_final_start
scn.frame_end = s.frame_final_end
fp = os.path.join(scn.render.filepath, s.name.split('.')[0] + '_part_' + str(count).zfill(2) + '.wav')
print ('saving', fp)
bpy.ops.sound.mixdown(filepath=fp, relative_path=False, container='WAV', codec='PCM', format='S16')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment