SHARE
TWEET

Untitled

a guest Jun 18th, 2019 61 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var credential = GoogleCredential.GetApplicationDefault();
  2. var client = SpeechClient.Create();
  3. var _longOp = client.LongRunningRecognize(new RecognitionConfig()
  4. {
  5.     Encoding = RecognitionConfig.Types.AudioEncoding.Linear16,
  6.     SampleRateHertz = 8000,
  7.     LanguageCode = languageCode
  8. }, RecognitionAudio.FromStorageUri(audioPath));
  9. _longOp = _longOp.PollUntilCompleted();
  10. var response = _longOp.Result;
  11. foreach (var result in response.Results)
  12. {
  13.     foreach (var alternative in result.Alternatives)
  14.     {
  15.         _transcipt += alternative.Transcript;
  16.     }
  17. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top