Perform Text-to-Speech on a String in C#

Is your writing just not speaking to you? You can take matters into your own hands with the Cloudmersive Speech API and convert written text to spoken language. You can then specify either MP3 or WAV file formats for the outcome of this operation. Let’s quickly walk through connecting in two easy steps in C# via the Cloudmersive API Console.

First things first, install the .NET Framework SDK:

Install-Package Cloudmersive.APIClient.NET.Speech -Version 4.0.1using System;
using System.Diagnostics;
using Cloudmersive.APIClient.NET.Speech.Api;
using Cloudmersive.APIClient.NET.Speech.Client;
using Cloudmersive.APIClient.NET.Speech.Model;

Then, for your second & final step, copy in the C# callback function and include your Cloudmersive API key where indicated.

namespace Example
public class SpeakTextToSpeechExample
public void main()
// Configure API key authorization: Apikey
Configuration.Default.AddApiKey("Apikey", "YOUR_API_KEY");
var apiInstance = new SpeakApi();
var reqConfig = new TextToSpeechRequest(); // TextToSpeechRequest | String input request
// Perform text-to-speech on a string
Object result = apiInstance.SpeakTextToSpeech(reqConfig);
catch (Exception e)
Debug.Print("Exception when calling SpeakApi.SpeakTextToSpeech: " + e.Message );




There’s an API for that. Cloudmersive is a leader in Highly Scalable Cloud APIs.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Going Serverless: how to run your first AWS Lambda function in the cloud

How To Dual-Boot Linux On Windows (Ubuntu 18.04 Gnome)

Big Data: Which architecture to choose? Comparison?

OAuth2 Implicit Grant with Red Hat SSO v7.1

Salesforce Integration Services: 7 Popular Apps for Salesforce Integration with Service Cloud

Career in Tosca

Our failure story with Redis operator for K8s (+ a brief look at Redis data analysis tools)

Git Merge vs Git Rebase

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store


There’s an API for that. Cloudmersive is a leader in Highly Scalable Cloud APIs.

More from Medium

Recognize Audio Input as Text with Machine Learning in C#

Pangram in C#

What is Middleware?