{"id":16683469,"url":"https://github.com/marcominerva/translatorservice","last_synced_at":"2025-03-21T18:32:48.226Z","repository":{"id":52647328,"uuid":"69556115","full_name":"marcominerva/TranslatorService","owner":"marcominerva","description":"A lightweight library that uses Cognitive Translator Service for text translation and Cognitive Speech Service for text-to-speech and speech-to-text","archived":false,"fork":false,"pushed_at":"2024-07-09T21:21:50.000Z","size":771,"stargazers_count":12,"open_issues_count":1,"forks_count":5,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-03-12T12:17:04.155Z","etag":null,"topics":["cognitive-services","hacktoberfest","speech","speech-api","speech-recognition","speech-to-text","text-to-speech","translation-service","translator"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/marcominerva.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-09-29T10:12:42.000Z","updated_at":"2023-11-14T12:47:42.000Z","dependencies_parsed_at":"2024-10-28T11:39:48.973Z","dependency_job_id":null,"html_url":"https://github.com/marcominerva/TranslatorService","commit_stats":{"total_commits":79,"total_committers":1,"mean_commits":79.0,"dds":0.0,"last_synced_commit":"1b7a27c340ec94f1ee365aba4784cd07ec22a037"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcominerva%2FTranslatorService","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcominerva%2FTranslatorService/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcominerva%2FTranslatorService/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcominerva%2FTranslatorService/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/marcominerva","download_url":"https://codeload.github.com/marcominerva/TranslatorService/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244153316,"owners_count":20406996,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cognitive-services","hacktoberfest","speech","speech-api","speech-recognition","speech-to-text","text-to-speech","translation-service","translator"],"created_at":"2024-10-12T14:24:50.813Z","updated_at":"2025-03-21T18:32:47.852Z","avatar_url":"https://github.com/marcominerva.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Translator Service\n\n[![GitHub Super-Linter](https://github.com/marcominerva/TranslatorService/workflows/Lint%20Code%20Base/badge.svg)](https://github.com/marketplace/actions/super-linter)\n\nA lightweight library that uses Cognitive Translator Service for text translation and Cognitive Speech Service for text-to-speech and speech-to-text.\n\nTo use this library, you must register an [All-In-One Cognitive Service](https://portal.azure.com/#create/Microsoft.CognitiveServicesAllInOne) or [Translator Service](https://portal.azure.com/#create/Microsoft.CognitiveServicesTextTranslation) and [Speech Service](https://portal.azure.com/#create/Microsoft.CognitiveServicesSpeechServices) on Azure to obtain the Subscription keys. Keep in mind that Regional endpoints are available, so you need to pass the region name to the library according to your registration.\n\n**Installation**\n\nThe library is available on [NuGet](https://www.nuget.org/packages/TranslatorService/). Just search *TranslatorService* in the **Package Manager GUI** or run the following command in the **Package Manager Console**:    \n\n    Install-Package TranslatorService\n    \n**Usage**\n\n**Translation**\n\nIt's usage is straightforward. For example, if you want to translate text:\n\n    // Use a Global Translator Service\n    var translatorClient = new TranslatorClient(\"\u003csubscription_key\u003e\");\n\n    // Use a Regional Translation Service\n    var translatorClient = new TranslatorClient(\"\u003csubscription_key\u003e\", \"\u003cregion\u003e\");\n    \n    // Use an external HttpClient (i.e. coming from IHttpClientFactory)\n    var translatorClient = new TranslatorClient(httpClient, \"\u003csubscription_key\u003e\", \"\u003cregion\u003e\");\n    \n    var response = await translatorClient.TranslateAsync(\"Today is really a nice day.\", to: \"it\");\n    Console.WriteLine(\n     $\"Detected source language: {response.DetectedLanguage.Language} ({response.DetectedLanguage.Score:P2})\");\n    \n    Console.WriteLine(response.Translation.Text);\n\n**Speech Recognition**\n\n    var speechClient = new SpeechClient(\"\u003csubscription_key\u003e\", \"\u003cregion\u003e\");\n    \n    // Use an external HttpClient (i.e. coming from IHttpClientFactory)\n    var speechClient = new SpeechClient(httpClient, \"\u003csubscription_key\u003e\", \"\u003cregion\u003e\");\n\n    var response = await speechClient.RecognizeAsync(audioStream, \"en-US\", RecognitionResultFormat.Detailed);\n    Console.WriteLine($\"Recognition Result: {response.RecognitionStatus}\");\n    Console.WriteLine(response.DisplayText);\n\n**Speech Synthesis**\n\n    var speechClient = new SpeechClient(\"\u003csubscription_key\u003e\", \"\u003cregion\u003e\");\n    \n    // Use an external HttpClient (i.e. coming from IHttpClientFactory)\n    var speechClient = new SpeechClient(httpClient, \"\u003csubscription_key\u003e\", \"\u003cregion\u003e\");\n\n    var responseStream = await speechClient.SpeakAsync(new TextToSpeechParameters\n        {\n            Language = \"en-US\",\n            VoiceType = Gender.Female,\n            VoiceName = \"en-US-AriaNeural\",\n            Text = \"Hello everyone! Today is really a nice day.\",\n        });\n\nIn the [Samples](https://github.com/marcominerva/TranslatorService/tree/master/Samples) folder are available samples for .NET Core and the Universal Windows Platform.\n\n**Contribute**\n\nThe project is continually evolving. We welcome contributions. Feel free to file issues and pull requests on the repo and we'll address them as we can. \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcominerva%2Ftranslatorservice","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarcominerva%2Ftranslatorservice","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcominerva%2Ftranslatorservice/lists"}