Пример #1
0
 public Aws(IAmazonS3 s3Client, IAmazonTranscribeService atClient, string bucketName)
 {
     _s3Client     = s3Client;
     _atClient     = atClient;
     _bucketName   = bucketName;
     _bucketRegion = s3Client.Config.RegionEndpoint.SystemName.ToString();
 }
 public TestController(DataContext context, IAmazonS3 s3Client,
                       IAmazonRekognition rekognitionClient, IAmazonTextract textractClient,
                       IAmazonPolly pollyClient, IAmazonTranscribeService transcribeClient)
 {
     _context               = context;
     this.S3Client          = s3Client;
     this.RekognitionClient = rekognitionClient;
     this.TextractClient    = textractClient;
     this.PollyClient       = pollyClient;
     this.TranscribeClient  = transcribeClient;
 }
        public static List <TranscribeLanguageDTO> GetLanguageList(IAmazonTranscribeService transcribeClient)
        {
            List <TranscribeLanguageDTO> result = new List <TranscribeLanguageDTO>();

            // See also : https://docs.aws.amazon.com/transcribe/latest/dg/what-is-transcribe.html
            result.Add(new TranscribeLanguageDTO("Gult Arabic", "ar_AE"));
            result.Add(new TranscribeLanguageDTO("Modern Standard Arabic", "ar-SA"));
            result.Add(new TranscribeLanguageDTO("Dutch", "nl-NL"));
            result.Add(new TranscribeLanguageDTO("Australian English", "en-AU"));
            result.Add(new TranscribeLanguageDTO("British English", "en-GB"));
            result.Add(new TranscribeLanguageDTO("Indian English", "en-IN"));
            result.Add(new TranscribeLanguageDTO("Irish English", "en-IE"));
            result.Add(new TranscribeLanguageDTO("Scottish English", "en-AB"));
            result.Add(new TranscribeLanguageDTO("US English", "en-US"));
            result.Add(new TranscribeLanguageDTO("Welsh English", "en-WL"));
            result.Add(new TranscribeLanguageDTO("Spanish", "es-ES"));
            result.Add(new TranscribeLanguageDTO("US Spanish", "es-US"));
            result.Add(new TranscribeLanguageDTO("French", "fr-FR"));
            result.Add(new TranscribeLanguageDTO("Canadian French", "fa-CA"));
            result.Add(new TranscribeLanguageDTO("Farsi", "fa-IR"));
            result.Add(new TranscribeLanguageDTO("German", "de-DE"));
            result.Add(new TranscribeLanguageDTO("Swiss German", "de-CH"));
            result.Add(new TranscribeLanguageDTO("Hebrew", "he-IL"));
            result.Add(new TranscribeLanguageDTO("Indian Hindi", "hi-IN"));
            result.Add(new TranscribeLanguageDTO("Indonesian", "id-ID"));
            result.Add(new TranscribeLanguageDTO("Italian", "it-IT"));
            result.Add(new TranscribeLanguageDTO("Japanese", "a-JP"));
            result.Add(new TranscribeLanguageDTO("Korean", "ko-KR"));
            result.Add(new TranscribeLanguageDTO("Malay", "ms-MY"));
            result.Add(new TranscribeLanguageDTO("Portuguese", "pt-PT"));
            result.Add(new TranscribeLanguageDTO("Brazilian Portuguese", "pt-BR"));
            result.Add(new TranscribeLanguageDTO("Russian", "ru-RU"));
            result.Add(new TranscribeLanguageDTO("Tamil", "ta-IN"));
            result.Add(new TranscribeLanguageDTO("Chinese Mandarin - Mainland", "zh-CN"));
            result.Add(new TranscribeLanguageDTO("Telugu", "te-IN"));
            result.Add(new TranscribeLanguageDTO("Turkish", "tr-TR"));

            return(result);
        }
Пример #4
0
 public AwsService(IAmazonUploader amazonUploader, IAmazonTranscribeService amazonTranscribeService, IHttpProxyClientService httpProxyClientService)
 {
     _amazonUploaderService   = amazonUploader;
     _amazonTranscribeService = amazonTranscribeService;
     _httpProxyClientService  = httpProxyClientService;
 }
 internal ListVocabularyFiltersPaginator(IAmazonTranscribeService client, ListVocabularyFiltersRequest request)
 {
     this._client  = client;
     this._request = request;
 }
Пример #6
0
 internal ListTranscriptionJobsPaginator(IAmazonTranscribeService client, ListTranscriptionJobsRequest request)
 {
     this._client  = client;
     this._request = request;
 }
 internal ListLanguageModelsPaginator(IAmazonTranscribeService client, ListLanguageModelsRequest request)
 {
     this._client  = client;
     this._request = request;
 }
 private Amazon.TranscribeService.Model.GetVocabularyResponse CallAWSServiceOperation(IAmazonTranscribeService client, Amazon.TranscribeService.Model.GetVocabularyRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Transcribe Service", "GetVocabulary");
     try
     {
         #if DESKTOP
         return(client.GetVocabulary(request));
         #elif CORECLR
         return(client.GetVocabularyAsync(request).GetAwaiter().GetResult());
         #else
                 #error "Unknown build edition"
         #endif
     }
     catch (AmazonServiceException exc)
     {
         var webException = exc.InnerException as System.Net.WebException;
         if (webException != null)
         {
             throw new Exception(Utils.Common.FormatNameResolutionFailureMessage(client.Config, webException.Message), webException);
         }
         throw;
     }
 }
Пример #9
0
 /// <summary>
 /// Constructs an instance with a preconfigured clients. This can be used for testing the outside of the Lambda environment.
 /// </summary>
 /// <param name="s3Client"></param>
 public Function(IAmazonS3 s3Client, IAmazonTranscribeService transcribeClient)
 {
     S3Client         = s3Client;
     TranscribeClient = transcribeClient;
 }
Пример #10
0
 /// <summary>
 /// Default constructor. This constructor is used by Lambda to construct the instance. When invoked in a Lambda environment
 /// the AWS credentials will come from the IAM role associated with the function and the AWS region will be set to the
 /// region the Lambda function is executed in.
 /// </summary>
 public Function()
 {
     S3Client         = new AmazonS3Client();
     TranscribeClient = new AmazonTranscribeServiceClient();
 }
Пример #11
0
 internal ListMedicalVocabulariesPaginator(IAmazonTranscribeService client, ListMedicalVocabulariesRequest request)
 {
     this._client  = client;
     this._request = request;
 }
Пример #12
0
 public SmokeTest()
 {
     transcribeServiceClient = new AmazonTranscribeServiceClient(Amazon.RegionEndpoint.USEast1);
 }
Пример #13
0
 internal ListCallAnalyticsJobsPaginator(IAmazonTranscribeService client, ListCallAnalyticsJobsRequest request)
 {
     this._client  = client;
     this._request = request;
 }
 internal TranscribeServicePaginatorFactory(IAmazonTranscribeService client)
 {
     this.client = client;
 }
Пример #15
0
        protected override void ProcessRecord()
        {
            base.ProcessRecord();

            Client = CreateClient(_CurrentCredentials, _RegionEndpoint);
        }
        public async static Task <string> TranscribeDemo(IAmazonTranscribeService transcribeClient, string lauguageCode, string mediaUri)
        {
            string result = null;
            Media  media  = new Media()
            {
                MediaFileUri = mediaUri
            };

            StartTranscriptionJobRequest transcriptionRequest = new StartTranscriptionJobRequest()
            {
                TranscriptionJobName = DateTime.Now.Millisecond.ToString(),
                Media            = media,
                MediaFormat      = MediaFormat.Wav.ToString(),
                LanguageCode     = lauguageCode,
                OutputBucketName = "reinvent-indiamazones"
            };

            try
            {
                Task <StartTranscriptionJobResponse> transcriptionTask     = transcribeClient.StartTranscriptionJobAsync(transcriptionRequest);
                StartTranscriptionJobResponse        transcriptionResponse = await transcriptionTask;
                TranscriptionJob transcriptionJob = transcriptionResponse.TranscriptionJob;

                bool loop = true;
                while (loop == true)
                {
                    if (transcriptionResponse.TranscriptionJob.TranscriptionJobStatus == TranscriptionJobStatus.IN_PROGRESS)
                    {
                        Console.WriteLine(transcriptionResponse.TranscriptionJob.TranscriptionJobName);
                        Console.WriteLine(transcriptionResponse.TranscriptionJob.TranscriptionJobStatus);
                        if (transcriptionResponse.TranscriptionJob.Transcript != null)
                        {
                            Console.WriteLine(transcriptionResponse.TranscriptionJob.Transcript.TranscriptFileUri);
                        }
                        Thread.Sleep(3000);
                    }
                    else if (transcriptionResponse.TranscriptionJob.TranscriptionJobStatus == TranscriptionJobStatus.COMPLETED)
                    {
                        Console.Write("Transcription job completed.");
                        DateTime completionTime = transcriptionJob.CompletionTime;
                        result = transcriptionJob.Transcript.TranscriptFileUri;

                        loop = false;
                    }
                    else
                    {
                        Console.WriteLine(transcriptionResponse.TranscriptionJob.TranscriptionJobStatus);
                        result = string.Empty;

                        loop = false;
                    }
                }

                result = transcriptionResponse.TranscriptionJob.Transcript.TranscriptFileUri;
            }
            catch (AmazonTranscribeServiceException transcribeException)
            {
                Console.WriteLine(transcribeException.Message, transcribeException.InnerException);
            }

            return(result);
        }