Skip to contents

Get Microsoft Text To Speech (TTS) or Cognitive Services Token from API Key

Check if token has expired

Usage

ms_get_token(api_key = NULL, region = "westus")

ms_token_expired(token = NULL)

Arguments

api_key

Microsoft Azure Cognitive Services API key

region

Subscription region for API key. For more info, see https://learn.microsoft.com/en-us/azure/cognitive-services/speech-service/regions

token

An authentication of class token, likely from ms_get_token

Value

A list of the request and token

Logical vector, indicating whether token has expired

Examples

if (FALSE) { # ms_valid_key()
# Get token where region is westus
token = ms_get_token(region = "westus")
}
if (FALSE) { # interactive()
# Check if token XXX has expired
ms_token_expired(token = "XXX")
}