Reputation: 3275
I asked this question on SuperUser, but it's fallen on deaf ears. Hopefully I can get more of an audience here.
I'm looking for a low cost (or Free) solution like ScriptVox only with a better engine. That is, to read in a script and assign characters to voice. I've read the post here but even with those I'd have to concatenate wav files. It's not that I don't love Audacity, but it is time consuming. I am halfway thinking of writing my own, but I'm sure there has to be a solution out there. Any suggestions?
Upvotes: 8
Views: 7425
Reputation: 2364
If having the program access internet is acceptable, then you could use iSpeech.
You can use their API, but unfortunately it is limited to 200 uses/day.
Their API also allows appending format=(wav|mp3)
following a query, allowing you to get your sound in both desired formats.
Upvotes: 3
Reputation: 23886
Brad's answer is pretty terrific, as it contains exactly what you're looking for. However, it's missing one fundament you'd expressed a preference for in the question errata: an implementation in C#.
Here's a full tutorial to gain access to the Speech API in managed code. With full credit to Blake Niemyjski and the appropriate teams at Microsoft, here's the salient bits, because the linkback to the original article is dead and this appears to be borrowed from Microsoft directly:
The following link (Giving Computers a Voice) will lead you to a Microsoft site that will show you how to create a project and get a basic text to speech application up and running in VB .Net or c# in no time!
SAPI
SAPI is the speech API that gives applications access to speech recognition and text-to-speech (TTS) engines. This article focuses on TTS. For TTS, SAPI takes text as input and uses the TTS engine to output that text as spoken audio. This is the same technology used by the Windows accessibility tool, Narrator. Every version of Windows since XP has shipped with SAPI and an English TTS engine.
TTS puts user's ears to work. It allows applications to send information to the user without requiring the user's eyes or hands. This is a very powerful output option that isn't often utilized on PCs.
Three steps are needed to use TTS in a managed application:
- Create an interop DLL
Since SAPI is a COM component, an interop DLL is needed to use it from a managed app. To create this, open the project in Visual Studio. Select the Project menu and click Add Reference. Select the COM tab, select "Microsoft Speech Object Library" in the list, and click OK. These steps add this reference to your project and create an Interop.SpeechLib.dll in the same folder as your executable. This interop DLL must always be in the same folder as your .exe to work correctly.
- Reference the interop namespace
Include this namespace in your application. In C#, add "using SpeechLib;"; iIn VB, add “Imports SpeechLib”.
- call Speak()
Create a SpVoice object and call Speak():
Visual C#
SpVoice voice = new SpVoice(); voice.Speak("Hello World!", SpeechVoiceSpeakFlags.SVSFDefault);
Visual Basic
voice = New SpVoice voice.Speak("Hello World!", SpeechVoiceSpeakFlags.SVSFDefault)
I feel Brad's answer led me to the correct solution here (thus, he's more deserving of credit than I), but this should be the last piece you were missing. You should now be able to replicate the WAV-file writing from the C++ solution in managed code, and from there, transcode into your desired format.
Upvotes: 5
Reputation: 3535
http://en.wikipedia.org/wiki/Comparison_of_speech_synthesizers
That's all I've got.
Google translate uses eSpeak http://support.google.com/translate/
Upvotes: 1
Reputation: 163301
I would use Microsoft's Text-to-Speech engine. They have a simple example on how to do exactly what you're looking for:
http://msdn.microsoft.com/en-us/library/ms717065(v=vs.85).aspx
With that sample code, you can speak some text and have it dumped to a WAV file. From there, if you need to convert to a format such as MP3, you can use FFMPEG.
Upvotes: 10