Re: How to use a synthesizer speak library in c#

2019-10-08 Thread AudioGames . net Forum — Developers room : Munawar via Audiogames-reflector


  


Re: How to use a synthesizer speak library in c#

https://raw.githubusercontent.com/munaw … iSpeech.cs/* This source is provided under the GNU AGPLv3  license. You are free to modify and distribute this source and any containing work (such as sound files) provided that:
* - You make available complete source code of modifications, even if the modifications are part of a larger project, and make the modified work available under the same license (GNU AGPLv3).
* - You include all copyright and license notices on the modified source.
* - You state which parts of this source were changed in your work
* Note that containing works (such as SharpDX) may be available under a different license.
* Copyright (C) Munawar Bijani
*/
using System;
using System.Speech.Synthesis;
using System.Runtime.InteropServices;
using System.ComponentModel;
using System.Text;
using System.Diagnostics;
using BPCSharedComponent.ExtendedAudio;
using BPCSharedComponent.Input;
using System.Threading;

namespace TDV
{
/// 
/// Output speech using a common screen reader or SAPI. Both 32-bit and 64-bit environments are supported with respect to the NVDA screen-reader.
/// 
public class SapiSpeech
{
// For the 32-bit versions, we'll keep the function names the same as in the headers.
[DllImport("nvdaControllerClient32.dll", CharSet = CharSet.Unicode)]
static extern int nvdaController_speakText(String text);
[DllImport("nvdaControllerClient32.dll", CharSet = CharSet.Unicode)]
static extern int nvdaController_cancelSpeech();
[DllImport("nvdaControllerClient32.dll", CharSet = CharSet.Unicode)]
static extern int nvdaController_testIfRunning();

// For the 64-bit counterparts, we'll use the nvdaController64 prefix.
[DllImport("nvdaControllerClient64.dll", EntryPoint = "nvdaController_speakText", CharSet = CharSet.Unicode)]
static extern int nvdaController64_speakText(String text);
[DllImport("nvdaControllerClient64.dll", EntryPoint = "nvdaController_cancelSpeech", CharSet = CharSet.Unicode)]
static extern int nvdaController64_cancelSpeech();
[DllImport("nvdaControllerClient64.dll", EntryPoint = "nvdaController_testIfRunning", CharSet = CharSet.Unicode)]
static extern int nvdaController64_testIfRunning();


/// 
/// Describes speaking methods.
/// 
public enum SpeakFlag
{
/// 
/// Start the message and immediately return.
/// 
none,
/// 
/// The thread blocks until the message finishes speaking.
/// 
noInterrupt,
/// 
/// The thread blocks until the message finishes speaking, and the currently speaking message, if any, will be flushed.
/// 
noInterruptButStop,
/// 
/// The thread blocks until a key is pressed or the message finishes speaking.
/// 
interruptable,
/// 
/// The thread blocks until a key is pressed or the message finishes speaking, and the currently speaking message, if any, will be flushed.
/// 
interruptableButStop
}

/// 
/// Defines what screen reader to use.
/// 
public enum SpeechSource
{
notSet,
SAPI,
auto
}
private static SpeechSynthesizer voice = null;
private static Stopwatch watch = new Stopwatch();
public static float screenReaderRate = 0f; // How many ms to speak one word.
private static long timeRequiredToSpeak = 0; // How many ms will be required to speak the current string of text?
private static string lastSpokenString = "";
private static Type JAWS, winEyes;
private static Object oJAWS, oWinEyes;
private static SpeechSource m_source;
public static SpeechSource source
{
get { return m_source; }
}

/// 
/// Initializes SAPI. This step is optional, but it's recommended to always have
/// SAPI initialized at least as a fallback.
/// The method also removes the JAWS keyboard hook.
/// 
private static void initialize()
{
if (voice == null)
voice = new SpeechSynthesizer();
}

/// 
/// Sets the screen reader to use.
/// 
/// The speaking source, such as SpeechSource.JAWS
public static void setSource(SpeechSource source)
{
m_source = source;
System.Diagnostics.Trace.WriteLine("Set speech source to " + source);
if (source == SpeechSource.SAPI)
initialize();
else {
initializeJAWS();
initializeWinEyes(); //if they have both JAWS and winEyes installed, load both since
 

Re: How to use a synthesizer speak library in c#

2019-10-06 Thread AudioGames . net Forum — Developers room : pauliyobo via Audiogames-reflector


  


Re: How to use a synthesizer speak library in c#

Not sure. I didn't know about universal speech and I then used Tolk.

URL: https://forum.audiogames.net/post/466410/#p466410




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: How to use a synthesizer speak library in c#

2019-10-05 Thread AudioGames . net Forum — Developers room : jsquared via Audiogames-reflector


  


Re: How to use a synthesizer speak library in c#

Has anyone found an advantage to using Tolk vs. Universal Speech?

URL: https://forum.audiogames.net/post/466363/#p466363




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: How to use a synthesizer speak library in c#

2019-08-27 Thread AudioGames . net Forum — Developers room : Makiocento via Audiogames-reflector


  


Re: How to use a synthesizer speak library in c#

Hi.Universal speech is a library that attempts to fulfill the same things that tolk does. You can wrap it, yeah.@nuno69: sorry, I wasn't checking this thingy for a long time ago, just entered to the university and were still coding with these guys.Mind if you send it to mtixilemat at estud.usfq.edu.ec, please? Remove the at letters, I just put them to avoid spam because it's my institutional Email.Thanks!Take care.Mike.

URL: https://forum.audiogames.net/post/458050/#p458050




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: How to use a synthesizer speak library in c#

2019-08-21 Thread AudioGames . net Forum — Developers room : bgt lover via Audiogames-reflector


  


Re: How to use a synthesizer speak library in c#

nuno69 wrote:Universal Speech can also be used, creating a wrapper is not that hard. I can do it for you if you want me toWhat is universal speech? Is it cross platform?

URL: https://forum.audiogames.net/post/456906/#p456906




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: How to use a synthesizer speak library in c#

2019-08-20 Thread AudioGames . net Forum — Developers room : bgt lover via Audiogames-reflector


  


Re: How to use a synthesizer speak library in c#

nuno69 wrote:Universal Speech can also be used, creating a wrapper is not that hard. I can do it for you if you want me toWhat is universal speech? Is it cross platform?

URL: https://forum.audiogames.net/post/456866/#p456866




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: How to use a synthesizer speak library in c#

2019-08-18 Thread AudioGames . net Forum — Developers room : bgt lover via Audiogames-reflector


  


Re: How to use a synthesizer speak library in c#

Well, what about the wrapper? have you managed something? Do you encounter problems somewhere along the road?

URL: https://forum.audiogames.net/post/456390/#p456390




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: How to use a synthesizer speak library in c#

2019-08-17 Thread AudioGames . net Forum — Developers room : bgt lover via Audiogames-reflector


  


Re: How to use a synthesizer speak library in c#

The espeak package can be found on the same website on which you can find espeak for sapi5 and espeak edit.I warn you, this is not easy because this lib has agreat many functions accept cdecl callbacks

URL: https://forum.audiogames.net/post/456136/#p456136




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: How to use a synthesizer speak library in c#

2019-08-17 Thread AudioGames . net Forum — Developers room : nuno69 via Audiogames-reflector


  


Re: How to use a synthesizer speak library in c#

Where is that espeak.h file? Why not wrap this for boredom?Guys, I started to love wrapping unmanaged libs to managed. I can do it all day!

URL: https://forum.audiogames.net/post/456093/#p456093




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: How to use a synthesizer speak library in c#

2019-08-16 Thread AudioGames . net Forum — Developers room : bgt lover via Audiogames-reflector


  


Re: How to use a synthesizer speak library in c#

Instead of using sapi, I recomand creating a wraper around a more powerfull and cross platform engine like espeach using the espeak.h that comes with the library when you download the source code. About the espeak.dll, you can get it from the nvda folder.I'd do it my self, but I don't know enough C because otherwise, I've done so for the new implementation of bgt(see first page of developers room) along with the already implemented sound class.

URL: https://forum.audiogames.net/post/455923/#p455923




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: How to use a synthesizer speak library in c#

2019-08-16 Thread AudioGames . net Forum — Developers room : nuno69 via Audiogames-reflector


  


Re: How to use a synthesizer speak library in c#

No, just tell me where I should send my work.

URL: https://forum.audiogames.net/post/455901/#p455901




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: How to use a synthesizer speak library in c#

2019-08-16 Thread AudioGames . net Forum — Developers room : Makiocento via Audiogames-reflector


  


Re: How to use a synthesizer speak library in c#

Greetings all.Well, thanks a lot for your comments. I actually had a meeting with the engineers that are coding the thing, and sapi for the thing they're coding, is not as responsive as that. Specially the one core new ones, I don't know if it does the same in english, but in spanish it leaves a silence of one and a half secs.Mind if you do a wrapper for us, nuno?Thanks!Take care.Mike.

URL: https://forum.audiogames.net/post/455878/#p455878




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: How to use a synthesizer speak library in c#

2019-08-16 Thread AudioGames . net Forum — Developers room : nuno69 via Audiogames-reflector


  


Re: How to use a synthesizer speak library in c#

Universal Speech can also be used, creating a wrapper is not that hard. I can do it for you if you want me to

URL: https://forum.audiogames.net/post/455792/#p455792




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: How to use a synthesizer speak library in c#

2019-08-16 Thread AudioGames . net Forum — Developers room : philip_bennefall via Audiogames-reflector


  


Re: How to use a synthesizer speak library in c#

Sapi can also be made more responsive if you read the audio data into memory and then trim silence from the beginning of the speech. Many voices do not distinguish between a phrase break and the beginning of a new piece of text, so they actually insert silence in the beginning. If you trim that, it becomes very responsive. I wrote an implementation a few weeks ago that did this, and it makes a world of difference.Kind regards,Philip Bennefall

URL: https://forum.audiogames.net/post/455787/#p455787




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: How to use a synthesizer speak library in c#

2019-08-15 Thread AudioGames . net Forum — Developers room : magurp244 via Audiogames-reflector


  


Re: How to use a synthesizer speak library in c#

Tolk supports microsoft.net for C#, so it should work given the project. The downloads been a bit wierd since febuary with some compiler changes though, you can get a previous verison off my repo [here] that should suffice.

URL: https://forum.audiogames.net/post/455763/#p455763




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector