teleshoes / ebook-audiobook-wordtiming

0 stars 1 forks source link

Add additional parameters to ebook-audiobook-wordtiming #3

Open plotn opened 9 months ago

plotn commented 9 months ago

Now, if I not wrong, file vosk-words-json executes from within ebook-audiobook-wordtiming:

 my $voskExec = "vosk-words-json";
  $voskExec = `command -v '$voskExec'`;
  chomp $voskExec;
  if($voskExec !~ /vosk-words-json/){
    die "ERROR: could not find vosk-words-json on PATH\n";
  }

  my @voskCmd = ($voskExec, $inputWaveFile, "--output=$destJSONFile");

  if(-x "$PYTHON_VOSK_VENV/bin/python3"){
    @voskCmd = ("$PYTHON_VOSK_VENV/bin/python3", @voskCmd);
  }

  run @voskCmd;

But vosk-words-json has some important parameters:

parser.add_argument("--model-path", type=str, dest="MODEL_PATH",
                      help=f"full path to a vosk model folder")
parser.add_argument("--model-name", type=str, dest="MODEL_NAME",
                      help="model name to use")
parser.add_argument("--model-lang", type=str, dest="MODEL_LANG",
                      help="language to select model")

And I think they are missing as parameters of ebook-audiobook-wordtiming, but they are needed. Could you add them?

teleshoes commented 9 months ago

yea, i do intend to add them. its a little complicated though, because of the caching