Before using this sample program, you will have to substitute in your own username and password for the service instance that you created earlier.
Let's take a look at what this program is doing:
- The program can take in three optional command-line arguments—the text string that you want to synthesize, the voice in which you want it expressed, and the
customization-idof any custom model that you want to use (assuming that you created one previously and have the
customization-idthat was created with it).
- The program begins by parsing and testing the inclusion of any of these three arguments on the command line in lines 84 through to 103.
- It reports on what it will be processing on line 106.
- Then, it invokes the
textSpeech()function, passing in the arguments that it found, if any, on the command line to do the speech synthesis processing...