Skip to content

Example project in C# .net to help you integrate with our text-to-speech API

Notifications You must be signed in to change notification settings

azreco/azreco-tts-csharp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AzReco Text To Speech API C# example

Sample project in c# .Net to help you integrate with our text-to-speech API.

This is a sample c# .Net project for uploading text file and saving the audio into a .wav file.

Supported languages

Azerbaijani (az-AZ)

Turkish (tr-TR)

Russian (ru-Ru)

Requirements

You will need to have the CommandLineParser and Microsoft.Net.Http module installed in your .Net environment.

For Windows please run commands below in terminal:

Install-Package Microsoft.Net.Http -Version 2.2.29

Install-Package CommandLineParser -Version 2.4.3

For .Net Core please run commands below in terminal:

dotnet add package Microsoft.Net.Http --version 2.2.29

dotnet add package CommandLineParser --version 2.4.3

Usage example:

In Windows OS native .Net environment:

client.exe --input-type file -t text\\example-tr.txt -l tr-TR -i api_user_id -k api_token --tts-id tts_id -o example-tr.wav

or

client.exe --input-type text -t "any text" -l tr-TR -i api_user_id -k api_token --tts-id tts_id -o example-tr.wav

In .Net Core environment:

dotnet client.dll --input-type file -t text\\example-tr.txt -l tr-TR -i api_user_id -k api_token --tts-id tts_id -o example-tr.wav

or

dotnet client.dll --input-type text -t "any text" -l tr-TR -i api_user_id -k api_token --tts-id tts_id -o example-tr.wav

In both environment the above command with input type 'file' the script uploads 'example-tr.txt', synthesizes speech using our tr-TR text-to-speech and saves the resulting audio as 'example-tr.wav' when the synthesizing process finished. The above command with input type 'text' the script sends text to the server, synthesizes speech using our tr-TR text-to-speech and saves the resulting audio as 'example-tr.wav' when the synthesizing process finished.

What is --tts-id option?

We have several voices for any language. Every voice has own identification. You can specify TTS identification with this option to get your audio file in different voices. This option is optional and TTS service selects default voice for the given language.

How to get voice identifications?

We added new REST get method http://api.azreco.az/voices?api_id=YOUR_API_ID&api_token=YOUR_API_TOKEN. You can call this method in any browser. We also added this into the Synthesizer class as a method. The result is JSON array of voice informations. For example:

[   
   {
      "id":TTS_ID,
      "ttsName":"VOICE_NAME",
      "ttsLanguage":"SHORT_LANGUAGE",
      "ttsGender":"GENDER"
   }
]

How to get user id and token?

To get user id and API token, send a request to info@azreco.az.

To confirm your request, we will ask you some details about your purpose in using API.

About

Example project in C# .net to help you integrate with our text-to-speech API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages