Artificial intelligent assistant

split wav file into parts of equal duration, padding with silence if needed I need to split wav files into multiple 10-second-long wav files, but each resulting wav file _must_ be exactly 10 seconds in length, adding silence if needed – so if a wav file's duration in seconds isn't a multiple of 10, the last wav file should be padded with silence. I've seen some answers (1, 2, 3) which show how to use sox and ffmpeg to split a file into chunks of equal length: $ ffmpeg -i file.wav -f segment -segment_time 10 -c copy out%03d.wav $ sox file.wav output-.wav trim 0 10 : newfile : restart but the last file produced by these commands is usually less than 10 seconds long. Is there a way to split a wav file, padding the last file if needed, in the same command?

Split the files, inspect the resulting files (`for i in *wav`), `if (length < 10 seconds)`, pad them.

* To get the wave file length: `sox --info -D file.wav`

* To pad the wave file: <




Maybe do some calculations :-)

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 2851a197605c3f26b022ad8c1c516139