Reply To: Automating HARK input with Batch Process

HARK FORUM Automating HARK input with Batch Process Reply To: Automating HARK input with Batch Process

#1497

Thank you for your inquiry.

First, create a network file for file input using AudioStreamFromWave . This is a normal network file that takes one WAV file as input. Please refer to Cookbook and Samples for how to create a network file.
Next, change the parameter type of the Constant node that is inputting the file name from string to subnet_param , and change the parameter value to ARG1 or string:ARG1 . Please refer here for the meaning of ARG<number> .
With this change, you can change the file name arbitrarily with the argument, so you can execute as follows.

If you want a network file named network.n to process a WAV file named input.wav:


harkmw ./network.n ./input.wav

After that, just write the loop of the file name as follows with shell script.

If you have a file list:


for f in <code>cat filelist.txt</code>; do
  harkmw ./network.n ${f};
done

Of course, you can also do the following.


for f in your_path/*.wav; do
  harkmw ./network.n ${f};
done

Note:
Generally, you should also change the output file. If you forget your changes, they will be overwritten during the loop. Do the same with parameters that set the output filename (or parameters that affect the output filename) for SaveWavePCM or Save...(your save node name)... in a similar way to the input file. The difference is that it uses ARG2 which means the second argument.

Best regards,
HARK support team