Google Speech-to-Text Transcriber

A plugin for IVR Tester to transcribe IVR call flows using Google Speech-to-Text.

Installation

1. Install the package

Install using yarn:

yarn global add ivr-tester-transcriber-google-speech-to-text

Or npm:

npm install -g ivr-tester-transcriber-google-speech-to-text

2. Setup Google Speech-to-Text

Follow Google Cloud Platform’s quick-start guide to:

  1. Setup a Google Cloud project
  2. Enable the Google Speech-to-Text service
  3. Create a service account
  4. Create then download a JSON key-file for the service account
  5. Set the GOOGLE_APPLICATION_CREDENTIALS environment variable to the path of the JSON key-file
export GOOGLE_APPLICATION_CREDENTIALS=/path/to/key.json

Configuration

Usage

CLI

Create the following block within your configuration file, adjusting the options property based on your needs:

{
    "transcriber": {
        "name": "google-speech-to-text",
        "options": {
            "languageCode": "en-GB",
            "useEnhanced": true,
            "speechPhrases": [
                "Press 1 for playback flow",
                "Press 2 for long pauses flow",
                "Press 3 for short latency flow",
                "Press 4 for long latency flow",
                "Please enter a number",
                "You entered the values 0123456789. Thank you."
            ]
        }
    }
}

Programmable interface

import { googleSpeechToText } from "ivr-tester-transcriber-google-speech-to-text";

const config: Config = {
    transcriber: googleSpeechToText(
        {
            languageCode: "en-GB",
            useEnhanced: true,
            speechPhrases: ["balance", "costing", "financial services"]
        }
    )
};

See the API’s documentation for details of each parameter.

Development

The code is part of IVR Tester’s GitHub repository.

Debugging

Console logging can be enabled by specifying the package name in the DEBUG environment variable:

DEBUG=ivr-tester-transcriber-google-speech-to-text
DEBUG_DEPTH=5

Copyright © 2023 Lucas Woodward