Use Plum's Transcription API
The following image shows how to construct a simple transcription application in Plum Fuse.
After the welcome prompt is a ‘record’ module. As you can see in the module text, the module prompts the user to leave a voice message. The module records the caller audio and saves it as a variable with the same name as the module, in this case record_message.
Next, the call-flow hits a REST module called transcription_api. The address for Plum’s transcription API goes in the first text field.
Enter your access credentials in the Header section. These are the same credentials you use to access Plum DEV (contact your account manager if you don’t already have a DEV login).
The format in the Header field must be: Authorization: Basic XXXXX
Replace the Xs with your login credentials converted to base 64. For example, format your credentials as ‘username:password’, e.g., FuseUser:12345 becomes RnVzZVVzZXI6MTIzNDU=.
The text in the Header section would then be: Authorization: Basic RnVzZVVzZXI6MTIzNDU=
Next, ensure that the Request type is a POST and that the return type is the same type as that specified in the URL. In this case, the resource type is JSON (the API also works with XML).
Finally, specify the variables. The API requires two variables: 1.) language and 2.) audio.
Language simply tells the transcription engine what language to use on the audio. So, if the audio is in English, choose the appropriate English setting. A list of compatible languages and dialects is available in the Transcription API documentation.
The audio variable consists of the recording made in the record_message module. Click the plus button to add a variable and begin typing “record_message” and the variable should auto-populate.
The final prompt reads back the transcribed audio as text-to-speech. Again, the transcription gets saved as the name of the module that performed the action. In this case, that is transcription_api.result.message. Use that as the name of the variable in your playback prompt.
You can also choose to send the transcribed text (i.e., the variable transcription_api.result.message) to a database or any other necessary repository for further use/analysis.
Last updated