static void Main(string[] args) { string _username = "******"; string _password = "******"; SpeechToTextServiceExample _speechToTextExample = new SpeechToTextServiceExample(_username, _password); Console.ReadKey(); }
static void Main(string[] args) { // Get credentials from environmental variables. Alternatively, instantiate the service with username and password directly. var environmentVariable = Environment.GetEnvironmentVariable("VCAP_SERVICES"); var fileContent = File.ReadAllText(environmentVariable); var vcapServices = JObject.Parse(fileContent); var _username = vcapServices["speech_to_text"][0]["credentials"]["username"]; var _password = vcapServices["speech_to_text"][0]["credentials"]["password"]; SpeechToTextServiceExample _speechToTextExample = new SpeechToTextServiceExample(_username.ToString(), _password.ToString()); Console.ReadKey(); }