In this guide, you’ll learn how to automatically transcribe live streaming audio in real time using Reverie’s SDKs, which are supported for use with the Reverie API.

Before you start, you’ll need to follow the steps in the Get your API Credentials to obtain your API KEY & APP ID.

Make your first Call

Make your first API Call using the cURL request. Add your own API Credentials where it says <YOUR-APP-ID> & <YOUR-API-KEY> and then run the following example in a terminal or your favorite API client.

curl --location --request POST 'https://revapi.reverieinc.com/' \
--header 'Content-Type: application/json' \
--header 'REV-API-KEY: <YOUR API KEY>' \
--header 'REV-APP-ID: <YOUR APP-ID>' \
--header 'src_lang: en' \
--header 'tgt_lang: hi' \
--header 'domain: generic' \
--header 'REV-APPNAME: localization' \
--header 'REV-APPVERSION: 3.0' \
--data '{
    "data": [
        "Reverie Language Technologies was established in 2009.",
        "The company head office is located in Bengaluru."
    ]
}'

By default, The API will return the strings in the target language.

SDKs

Reverie has several SDKs that can make it easier to use the API. Follow these steps to use the SDK of your choice to make a Reverie Translation request.

Install Dependencies

npm i @reverieit/reverie-client

Translate Text to your preferred language

The following code shows how to convert the text to your preferred language.

const ReverieClient = require("reverie-client");

const reverieClient = new ReverieClient({
  apiKey: "YOUR-API-KEY",
  appId: "YOUR-APP-ID",
});

async function translateText() {
  const translation = await reverieClient.translate({
    text: "Hey there, how are you doing?",
    src_lang: "en",
    tgt_lang: "or",
  });
  console.log(translation);
}

translateText();

Results

In order to see the results from Reverie, you must run the application. Run your application from the terminal. Your transcripts will appear in your shell.

# Run your application using the file you created in the previous step
# Example:
npm start

Analyzing the Response

The API returns a responseList, which is an array containing the localized content. Each item includes the inString, representing the original input text in the source language, and the corresponding outString, which contains the translated text in the requested target language.