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 'cnt_lang: en' \
--header 'REV-APPNAME: transliteration' \
--header 'REV-APPVERSION: 2.0' \
--data-raw '{"data": ["Reverie Language Technologies ltd website address is www.reverieinc.com"],
}'

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 Transliteration request.

Install Dependencies

npm i @reverieit/reverie-client

Transliterate 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 transliterateText() {
  const translation = await reverieClient.transliterate({
    text: "Namaste",
    src_lang: "en",
    tgt_lang: "ta",
  });
  console.log(translation);
}

transliterateText();

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 transliterated content. Each item includes the inString, representing the original text in the source script, and the corresponding outString, which is the result of converting that text into the target script. Additionally, the response includes an api_status field, where a value of 2 indicates a successful transaction.