Play Audio File

Plays an audio file during the IVR communication process, with the ability to interrupt audio by pressing an escape digit.

Starting from IBM RPA 23.0.3, this command is removed from the product. For more information, see Removed.

Important:As a result from the command's removal on IBM RPA 23.0.3, it no longer works on newer IBM RPA client versions.

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.

ivrPlayFile [--isfromasset(Boolean)] --assetname(String) --filename(String) [--escapedigits(String)] (String)=value

Input parameter

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
Load file isfromasset Optional Boolean Enable to use audio assets.
File from asset assetname Required when Load file is True Text Audio file imported through an asset.
File filename Required when Load file is False Text Audio file to play.
Escape digits escapedigits Optional Text Digit to interrupt audio playback.

Output parameter

Designer mode label Script mode name Accepted variable types Description
Digit value Text Returns the digit pressed by the user. If none is pressed, returns the digit 0.

Example

During the process of communication between IVR bot and user, the Play Audio File command is used to play audio, allowing the user to interrupt it by entering the number "1".

defVar --name voiceEngine --type SpeechEngine
defVar --name englishLanguage --type Language
defVar --name userResponse --type String
defVar --name typeToStopAudio --type String
// Create the vocalization and language that will be used by IVR.
googleEngine --culture "en-US" --voice "en-US-Standard-D" voiceEngine=value
createLanguage --culture "en-US" --speech ${voiceEngine} englishLanguage=value
// Connects the interface of interaction between IVR and user.
botConnect --type "Ivr" --language ${englishLanguage} --timeout 00:02:00
	botSay --text "Hi! You will hear a sentence and in the end tell us what you understand.\r\n"
// Download the following file to execute the command.
	ivrPlayFile --filename "audioIvrPlayFileExample.mp3" --escapedigits 1 typeToStopAudio=value
	botAsk --beep  --text "Well, what did you think of the audio played?" userResponse=utterance
botDisconnect
Note:When you run this command using IVR type, you get prompted by a window to call the IVR. This window might show a phone number or the Zoiper QR code to calls via the Zoiper application. You see this window in debug mode in the IBM RPA Studio.

Starting from IBM RPA 23.0.3, this window isn't available due to the IVR removal. For more information, see Removed.