@ben sorry I didn't write a tutorial on this bc I wasn't sure exactly what problems people would run into.
@mattia.paterna thanks for clarifying!
Just to be clear, this is what the output should look like and here's some example runs.
Help output:
murphy@emergentprocess ~/tmp/code
$ ./split_wave_file.py -h
usage: split_wave_file.py [-h] -s SOURCE -d DESTINATION_DIRECTORY [-p PREFIX]
-n NUMBER_OF_SLICES
optional arguments:
-h, --help show this help message and exit
-s SOURCE, --source SOURCE
Source Sound File (default: None)
-d DESTINATION_DIRECTORY, --destination_directory DESTINATION_DIRECTORY
Split Files Destination (default: None)
-p PREFIX, --prefix PREFIX
Sliced File Prefix (default: None)
-n NUMBER_OF_SLICES, --number_of_slices NUMBER_OF_SLICES
Number of Slices (default: None)
Example output with foo.wav into 2 slices:
murphy@emergentprocess ~/tmp/code
$ ./split_wave_file.py -s foo.wav -d ./bar -n 2
[2020-06-17 06:47:39,589] Source - foo.wav
[2020-06-17 06:47:39,589] Destination Directory - ./bar
[2020-06-17 06:47:39,589] Number of Slices - 2
[2020-06-17 06:47:39,589] Number of Frames - 261333
[2020-06-17 06:47:39,589] Frames Per Slice - 130666
[2020-06-17 06:47:39,589] Leftover Frames - 1
[2020-06-17 06:47:39,589] Writing - ./bar/foo_001.wav
[2020-06-17 06:47:39,589] Set Position - 0
[2020-06-17 06:47:39,590] Writing - ./bar/foo_002.wav
[2020-06-17 06:47:39,590] Set Position - 130666
Example output with the prefix specified:
murphy@emergentprocess ~/tmp/code
$ ./split_wave_file.py -s foo.wav -d ./bar -n 2 -p baz
[2020-06-17 06:49:05,443] Source - foo.wav
[2020-06-17 06:49:05,443] Destination Directory - ./bar
[2020-06-17 06:49:05,443] Number of Slices - 2
[2020-06-17 06:49:05,443] Prefix - baz
[2020-06-17 06:49:05,443] Number of Frames - 261333
[2020-06-17 06:49:05,443] Frames Per Slice - 130666
[2020-06-17 06:49:05,443] Leftover Frames - 1
[2020-06-17 06:49:05,443] Writing - ./bar/baz_001.wav
[2020-06-17 06:49:05,443] Set Position - 0
[2020-06-17 06:49:05,444] Writing - ./bar/baz_002.wav
[2020-06-17 06:49:05,444] Set Position - 130666
Please let me know if you have any other questions - this is the first bit of code I've ever put into the public, so I don't know what people are looking for to help them get their head around my scripts.
Edit: I also uploaded the code so the default wave file name will be the file without its suffix. The code as of last night will do "foo.wav_001.wav" which works but is ugly.