• SharpTalk: A .NET wrapper for the DECtalk TTS engine.
    31 replies, posted
This project was inspired by the creative antics of those utilizing Moonbase Alpha's TTS feature. Aeiou. I searched around exhausively and for a decent TTS engine apart from Microsoft's SAPI, which has a .NET implementation. I don't like SAPI because its features are complicated, it depends on having custom voices installed, and SSML generally makes me want to puke. Eventually, I came across DECtalk (the Moonbase Alpha TTS) and its accompanying SDK, from which I was able to get documentation for its functions. I spent countless hours implementing these in C# using P/Invoke, and I eventually got it working. I present to you: [B]SharpTalk[/B]. [video=youtube;spYGYzEKbKM]http://www.youtube.com/watch?v=spYGYzEKbKM[/video] [B]Main Features[/B]: • Asynchronous speaking • Phoneme events for mouth movements in games/animations • Sync() method for synchronous speaking • Adjustable voice and speaking rate • Multiple engines can be independently controlled and talking at the same time • Voices can be paused/resumed [B][URL="https://github.com/TheBerkin/SharpTalk"]Source code on GitHub[/URL][/B] [B][URL="http://www.mediafire.com/download/l642kquav29qkyp/SharpTalk.zip"] [/URL][/B][I](I used to have a download link to a compiled version here, but removed it because it was a pain in the ass to update after every commit, and also because some people don't use .NET. It is better to compile it yourself.[/I]) If you do something cool with this library, I would be delighted to see.
glorious
I was hoping to rewrite SteamTTS with something like this, but then I saw .NET (I don't know C#, C++ is more my thing) anyway, nice job man.
[QUOTE=Adult;43637615]I was hoping to rewrite SteamTTS with something like this, but then I saw .NET (I don't know C#, C++ is more my thing) anyway, nice job man.[/QUOTE] Even with C++, you can still use my library if you're making a CLR application.
[QUOTE=Berkin;43637716]Even with C++, you can still use my library if you're making a CLR application.[/QUOTE] nah, i don't like making programs that only run on one platform, whether it be windows or linux. i like my things being cross-platform :)
[QUOTE=Adult;43637818]nah, i don't like making programs that only run on one platform, whether it be windows or linux. i like my things being cross-platform :)[/QUOTE] Fair enough. Good luck with your project!
[QUOTE=Adult;43637818]nah, i don't like making programs that only run on one platform, whether it be windows or linux. i like my things being cross-platform :)[/QUOTE] C# works on linux with mono though. Though this library might not be compatible depending on the source code.
[QUOTE=Skipcast;43640367]C# works on linux with mono though. Though this library might not be compatible depending on the source code.[/QUOTE] Generally if the wrapped library is cross-platform, your wrapper for it will also be cross-platform.
[QUOTE=robmaister12;43643242]Generally if the wrapped library is cross-platform, your wrapper for it will also be cross-platform.[/QUOTE] As far as I am aware, DECtalk also works on Linux. Not sure about Mac, though.
Is anyone else getting "this version of DECtalk does not support multiple languages"?
Unrelated but I think your bot replies too quickly. You should add in typing time (and thinking / reading time) when responding to make it seem more real.
[QUOTE=Rohans;43647310]Is anyone else getting "this version of DECtalk does not support multiple languages"?[/QUOTE] Interesting, I will check on which version of the library I included in the repo. Would you like me to add an option to override language loading in the meantime? I am fairly certain it can run without it. [editline]23rd January 2014[/editline] [QUOTE=benjojo;43647570]Unrelated but I think your bot replies too quickly. You should add in typing time (and thinking / reading time) when responding to make it seem more real.[/QUOTE] The actual chat is much slower. I cut out a lot of the delay from the video so people wouldn't get bored.
[QUOTE=Berkin;43647606]Interesting, I will check on which version of the library I included in the repo. Would you like me to add an option to override language loading in the meantime? I am fairly certain it can run without it.[/QUOTE] Yeah, I was trying to do that but I'm not sure how it all works.
Rohans: I added a new language constant, LanguageCode.None, which tells the library to skip language loading. You can use that until I figure out what's going on. Usage: [CODE]DECTalkEngine tts = new DECTalkEngine(LanguageCode.None);[/CODE]
Still doesn't work. Running it as admin writes this to a log file (\\dtlic.log): 01/23/14 19:21:25 : Text-to-speech license information invalid! That might be a problem.
[QUOTE=Rohans;43648049]Still doesn't work. Running it as admin writes this to a log file (\\dtlic.log): 01/23/14 19:21:25 : Text-to-speech license information invalid! That might be a problem.[/QUOTE] That makes sense. I installed the [URL="http://theflameofhope.co/dectalkreader1/"]SDK[/URL] to get the documentation and the DLL, so that might be why I'm not having that issue.
[QUOTE=Skipcast;43640367]C# works on linux with mono though. Though this library might not be compatible depending on the source code.[/QUOTE] i also don't know C#
Well guys, I just made an interesting development. I switched out the DECtalk dll for the FonixTalk dll from SteamTTS, and it works just the same. Maybe this will fix that licensing issue. :v: I'll commit the update as soon as I make sure everything is working correctly. [editline]24th January 2014[/editline] The update is out now. Let me know if there are any other problems. P.S.: Pass this to Speak() for a surprise. [CODE][:dv gv 0 hs 100 br 100 as 100 gn 100 ap 100][/CODE]
Interesting find on the SDK. When I was doing something with FonixTalk, I still had to disassemble the dll to guess some function headers :v: [QUOTE=Skipcast;43640367]C# works on linux with mono though. Though this library might not be compatible depending on the source code.[/QUOTE] You can't P/Invoke win32 libraries on other platforms. And I haven't seen the Linux version of FonixTalk floating around anywhere.
[QUOTE=DrTaxi;43666080]Interesting find on the SDK. When I was doing something with FonixTalk, I still had to disassemble the dll to guess some function headers :v:[/QUOTE] I was skeptical at first about whether or not the function documentation would be the same for FonixTalk, but I was pleasantly surprised when it worked. The only thing I had to change to make it work was the functions' calling conventions (DECtalk uses Cdecl, whereas FonixTalk uses StdCall). I haven't been able to get TextToSpeechSetSpeakerParams() to work properly, though. I think it has to do with pointers. If you can figure out what's wrong, feel free to add it in/send a pull request.
I believe I had that working in my code once, but scrapped it as I hit (I think) a Mono bug. (Yes, I then had to run that application on Linux, so inside Mono, inside Wine. Fun.) As far as I can see, you haven't wrapped the save-to-file functionality. Have you just not bothered yet, or were there problems? Because I definitely do have that working. In any case, I'll check later if I have anything worth pulling in.
[QUOTE=DrTaxi;43671924]I believe I had that working in my code once, but scrapped it as I hit (I think) a Mono bug. (Yes, I then had to run that application on Linux, so inside Mono, inside Wine. Fun.) As far as I can see, you haven't wrapped the save-to-file functionality. Have you just not bothered yet, or were there problems? Because I definitely do have that working. In any case, I'll check later if I have anything worth pulling in.[/QUOTE] I haven't gotten around to saving stuff yet. I'm using the library for another project, so I only implemented what I needed. I'll add saving eventually, though.
Is there anything that you are using or can think of that would prevent this from working with Visual Studio 2010 Pro? I couldn't open the project so I had to rebuild it. It seems to compile fine and a very basic test console app using your examples from Github leaves the window open long enough, when run with debugging from VS, to seem like it's doing anything but I don't get any audio. Also, if I attempt to run the app from outside VS, it just exits immediately.
Great find! Is there any chance that you could get DecTalk to work? I'm not fond of the new Harry voice in FonixTalk and would much prefer the Harry voice from DecTalk. :) Additionally (even if DecTalk isn't possible), is there a way to save the TTS output into a wav audio file?
[QUOTE=Obsurveyor;44259905]Is there anything that you are using or can think of that would prevent this from working with Visual Studio 2010 Pro? I couldn't open the project so I had to rebuild it. It seems to compile fine and a very basic test console app using your examples from Github leaves the window open long enough, when run with debugging from VS, to seem like it's doing anything but I don't get any audio. Also, if I attempt to run the app from outside VS, it just exits immediately.[/QUOTE] Make sure the FonixTalk libraries are in the working directory when you run it. [editline]26th March 2014[/editline] [QUOTE=sswords;44353234]Great find! Is there any chance that you could get DecTalk to work? I'm not fond of the new Harry voice in FonixTalk and would much prefer the Harry voice from DecTalk. :) Additionally (even if DecTalk isn't possible), is there a way to save the TTS output into a wav audio file?[/QUOTE] DECtalk is protected by licensing stuff that I can't seem to get around. FonixTalk seems not to have that, though. It has all the same features as DECtalk with a few minor variations. I plan on wrapping the WAV exporting stuff pretty soon. I'm busy with school right now, but I'll find the time.
Sorry to dig this thread up from the grave, but maybe someone with some Python/C# expertise can help me. I was able to get DECtalk working by first launching the GWDEC32.exe file. This works, however, I'm curious if it's possible to avoid doing this. While browsing for a solution, I stumbled upon a supposed fix that someone created for NVDA (not familiar with this) and created a python script which bypasses the GWDEC32 file requirement. The thread about it can be found here: [url]http://forum.audiogames.net/viewtopic.php?id=11282[/url] The fix itself can be obtained here: [url]https://dl.dropboxusercontent.com/u/31135724/access32.nvda-addon[/url] Simply unzip the download and open the python script with a text editor...inside you'll notice that it looks vaguely familiar to the C# library. I'm curious if it's possible to port the python code to C# which removes the license restriction that DECtalk has.
Why don't you just use FonixTalk (as bundled with this wrapper)?
-snip, bad reading-
[QUOTE=sswords;45780417][...] I'm curious if it's possible to port the python code to C# [B]which removes the license restriction that DECtalk has[/B].[/QUOTE] (emphasis mine) I can guarantee you that that NVDA is exactly as illegal as the original executable :rolleyes: [editline]25th August 2014[/editline] [QUOTE=DrTaxi;45784362]Why don't you just use FonixTalk (as bundled with this wrapper)?[/QUOTE] Redistributing that is not actually legal either...
Oh, I missed the licensing comment. The required files are available in the [url=http://support.speechfxinc.com/files/FonixTalk%206.1%20Demo.zip]SDK Demo[/url]. I didn't see a licensing agreement, but merely downloading them from there shouldn't be a problem. Using them with reverse-engineered headers, though, and/or redistributing them, I don't know, and I'm not a lawyer.
Sorry, you need to Log In to post a reply to this thread.