Transcript

Transcribes the contents of an audio file to text. The contents vary according to the output channel.

Command availability: IBM RPA SaaS and IBM RPA on premises

Script syntax

IBM RPA's proprietary script language has a syntax similar to other programming languages. The script syntax defines the command's syntax in the script file. You can work with this syntax in IBM RPA Studio's Script mode.

transcript --culture(Culture) --source(String) --provider(SpeechProvider) [--apikey(Text)] (Boolean)=success (String)=left (String)=right

Dependencies

An API key from the Google Cloud Speech-to-Text ™ External link service is required. Enter the key in the API Key parameter. This command does not work without a valid key.

Input parameters

The following table displays the list of input parameters available in this command. In the table, you can see the parameter name when working in IBM RPA Studio's Script mode and its Designer mode equivalent label.

Designer mode label Script mode name Required Accepted variable types Description
Language culture Required Text, Culture If you define the language manually, make sure to enter only supported language codes.

The command uses the provider's supported languages.
Source source Required Text Full path of the audio file.
The command accepts .ogg, .mp3, and .wav file formats.
Provider provider Required SpeechProvider Provider used to transcribe the audio file into text. See the available providers in the provider parameter options.
API Key apikey Required Text Path to the provider's a valid API key.

provider parameter options

The following table displays the options available for the provider input parameter. The table shows the options available when working in Script mode and the equivalent label in the Designer mode.

Designer mode label Script mode name Description
Google Google Google Cloud™ speech recognition provider.

Output parameters

Designer mode label Script mode name Accepted variable types Description
Success success Boolean Returns True if the audio was successfully transcribed, or False otherwise.
Left left Text Returns the transcribed audio from the left audio channel.
Right right Text Returns the transcribed audio from the right audio channel.

Example

The following example does not provide an audio file to transcribe. You must use your own audio file to transcribe.

defVar --name executionResult --type Boolean
defVar --name leftChannel --type String
defVar --name rightChannel --type String
transcript --culture "en-US" --source "audioTranscript.mp3" --provider "Google" executionResult=success rightChannel=right leftChannel=left
logMessage --message "Success: ${executionResult}\r\nLeft: ${leftChannel}\r\nRight:  ${rightChannel}" --type "Info"
Important:Enter a valid audio file in the Source parameter and a valid key in the API Key parameter.