vgm_sptd

From vgmrips

VGM Splitter (Delay Edition)

This tool splits a VGM file into smaller pieces, based on regions of silence. This is useful if you recorded many songs to one file (e.g. in MAME/MESS). You can also use it to quickly trim beginning (or end, for non-looping tracks) silence from individual tracks (see caveats below), but please note tags from the source VGM won't transfer to the split ones. If you goofed, use vgm_tt to transfer tags.

Usage:

vgm_sptd [-digits:#] your.vgm [Delay length to split on]

Delays/"Silence" is determined by long Wait commands. The delay is given in samples: the default is 32768, about 0.75s. (1 second has 44100 samples in VGMs.) Even if the total delay between VGMs is larger, all of the silence before and after a split is stripped. You should have no silence at the beginning or end of the split file.

With the -digits option on the command line, you can control the number of digits the resulting filenames have. Replace # with the number you want.

(Note that you can auto-remove these suffixes with vgm_name if need be, though you'll have to move/remove the original or split file first. The use case isn't common, but does exist.)

The unmaintained GitHub readme says:

Sometimes it seems to produce some empty files if you use delay values >= 65536, but all others should be bug-free.

However, I found successful silence trimming for single track recordings produced at least two files. "_01" then seems to contain silence whereas "_02" and beyond have the desired song data (possibly alternated with more silence slices?).

When only "_01" is made, some data may've been trimmed but probably not as much as you want. Try a lower split sample number; if you got undesired splits within song data, raise the number in increments. If that still doesn't work (or didn't in the first place, because there were no Wait commands long enough) you'll have to use vgm_spts instead.

For instance, there may be times beginning silence isn't actually being trimmed by vgm_sptd, and/or using smaller delay lengths makes way too many files (like with songs that go silent before they loop). In the first case, try vgm_spts with a very low staring sample like 100:

vgm_spts your.vgm 100 -1

If both splitters trim silence that's part of the song when played in game, you might need to record the track on its own and manually trim the start point with vgm_trim.