Jump to content

What is a good free Text to Speech library which is easy to code for in C#

grimreeper132

As the title asks, I am making a small programme which in which I need to generate a audio output using text to speech (preferably in a wav format). This is going to be used for a TTRPG game (creating audio for robots etc. so it's ok if it sounds robotic)

What is a good text to speech add in which I can use.


I have a couple requirements for this

1) This is a home project, with no budget, so it should be Free

2) It must have access to a number of different voices, more the better, I will need at least 10-20, I am happy to install custom voices packages here, as long as it's not too much of a pain

3) It should be reasonably easy to interface with, but I am willing to deal with some level of difficulty

4) Additionally, it would be ideal if I could run it locally on a laptop, encase I don't have access to the internet when running it, as I may be using this for an in person game. However, if this isn't possible I am happy to require the internet, but it must still be free.


Any questions please ask.

The owner of "too many" computers, called

The Lord of all Toasters (1920X 1080ti 32GB)

The Toasted Controller (i5 4670, R9 380, 24GB)

The Semi Portable Toastie machine (i7 3612QM (was an i3) intel HD 4000 16GB)'

Bread and Butter Pudding (i7 7700HQ, 1050ti, 16GB)

Pinoutbutter Sandwhich (raspberry pi 3 B)

The Portable Slice of Bread (N270, HAHAHA, 2GB)

Muffinator (C2D E6600, Geforce 8400, 6GB, 8X2TB HDD)

Toastbuster (WIP, should be cool)

loaf and let dough (A printer that doesn't print black ink)

The Cheese Toastie (C2D (of some sort), GTX 760, 3GB, win XP gaming machine)

The Toaster (C2D, intel HD, 4GB, 2X1TB NAS)

Matter of Loaf and death (some old shitty AMD laptop)

windybread (4X E5470, intel HD, 32GB ECC) (use coming soon, maybe)

And more, several more

Link to comment
Share on other sites

Link to post
Share on other sites

Well if you are running on windows it's easy, you can use windows text to speech

 

 var synthesizer = new SpeechSynthesizer();
synthesizer.SetOutputToDefaultAudioDevice();
synthesizer.Speak("Some text to say");

This simply transform any text to speech using the default audio source so typically your speaker on a laptop.

Now windows come with at least 1 male, 1 female voices installed with your OS language but you can install more. I had at least 5 male/ 5 female for both english and french.

 

You can see which you currently have with the synthesizer object using the get installed voices

var voices = synthesizer.GetInstalledVoices()

 

Now that is not a perfect voice simulation but way better than your need. Now seems likes 2-3 voices isn't enough right ? well actually it is. Since you actually decide the audio output device of where the sound is going you can easily redirect to :

1 - You own audio coded device with NAudio (a .net lib) and grab the wave and apply filter to speed up, slow down, increase/decrase pitch... to change the voice output

2 - OBS and apply filters on audio source

3 - Audacity and do whatever you want with the audio.

 

All this is 100% free and 100% off the grid. I actually build something similar to this to read prompt text file with thousands of different voice, randomly generated at first and filtered after. that was back in 2006-2007 and i believed they are still using it.

 

This whole feature set also come with Speech to text. Back then i use to listen to user prompt and make my own assitant and respond to his demand but nowaday you could simply add ChatGPT and make players have conversation with the AI. You just need to tell it first who he is, what he knows, what he's trying to convey and let them speak to your laptop lol.

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×