Automating HARK input with Batch Process

  • このトピックには1件の返信、2人の参加者があり、最後に匿名により5年、 11ヶ月前に更新されました。
2件の投稿を表示中 - 1 - 2件目 (全2件中)
  • 投稿者
    投稿
  • #1493
    匿名
    参加者

    Hello
    I am trying to preprocess my HARK audio files. I have more than 100 audio files so is there any way that I can Automate the inputof audio file to HARK instead of selecting each file manually. Please let me know if there is a way to do it. I am using HARK on Ubuntu.
    Thank you
    Riya.

    #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

2件の投稿を表示中 - 1 - 2件目 (全2件中)
  • このトピックに返信するにはログインが必要です。