To improve the usability of tasks, you can change some of the configuration parameters into action parameters that you specify when you send an action. To do this, set the task configuration parameters to built-in variable values.
These variables can either:
Variable parameters give you complete flexibility with modules. For example, if you have a single task that requires two stt
modules (stt
and stt1
), you can ensure that each stt
module uses different action parameters in the AddTask
action.
Another example of how you might use variable values is if you want to create temporary files. You can use the $token
built-in variable. Because this is the same as the unique token ID returned for each task, you can also use it as a file name associated with that task for temporary file purposes.
Note: You must use UTF-8 to encode action parameters stored on disk, for example in the configuration file.
You can use the $outfile
built-in variable if you want Speech Server to automatically generate a unique file name for an output file, instead of specifying the file name yourself. For example, the default configuration for the [wout]
module for the wavToText
task is shown below:
[wout] format = ctm output = $params.out = $outfile outputLabel = out
If you specify an output file name as part of the action (for example, Out=test.ctm
), Speech Server uses that name. If you do not specify a file name in the action, Speech Server automatically generates a name based on a combination of the task token, the name of the module that generates the output file, and the name of the parameter used to specify the output file name. For example, in the case above, the file name might be tmp_MTkyLjE2OC45NS4yNDox_wout_output
.
Speech Server writes the file to the standard directory for the output type (TempDir
, SpeakerIDDir
, and so on).
You can send a GetStatus
action with the task token to determine the names of the output files generated by a task. The output files are listed in the response.
|