|
|
hmm I've taken a look at it and looks interesting. Might be the one I'm looking for.
Thanks!
|
|
|
|
|
am working on a large vocabulary continious speech recognition project for Amharic( Ethiopian) language using SAPI . i used the grammer class to bullid the neccesery grammer for the command mode and it worked with good accuarcy. the problame is with dectation mode. b/c there is no amharic SR engine, i want to adapt the english SR engine for amharic. my question is is there any way to capture the recognized phoneme of the speech using SAPI. not the recognized words... iwant to map the recognized phenomes to there equivalent amharic charcters. .. plz help
tnx in advance
modified on Thursday, November 12, 2009 2:14 PM
|
|
|
|
|
Simply reading out the recognized phonemes will not help you. The phoneme recognition in dictation is not 100% fixed. The recognised phonemes depend a lot on assumptions made by the engine on which words and thereby which (sometimes very similar) phonemes make the most sense in the context (see SpeechPartOfSpeech
list). If you make a little program that displays you all the OnHypothesis events of SAPI or displays the alternate recognitions you get a little taste of what's going on inside the engine. So even when you read out the phonemes, they will still represent whatever English words the engine thinks might fit at the time as it has no idea about Amharic. The results for dictation in Amharic will most likely be useless.
The command mode works very different from the continuous dictation mode. It has a very small number of possible results, so it tends to work quite well when you feed it with a different language. The several hundred thousand possibilities in free dictation are quite a different thing...
If you want good results, I'm afraid you need to make your own engine (see the sample code in the SDK). That's a lot of work you have ahead of you... Good luck!
PS: The only way I know how to get the phonemes is to let the recognised phrase run through the TTS engine after recognition which obviously doesn't help with your problem...
|
|
|
|
|
thanks 4 your suggestion and I got wat u r saying. But Amharic unlike English have specific character representation 4 each phoneme. for example "dog" in english is represnted by 3 characters but in amharic it is represented by 2 characters "ዶግ" which is equal to the syllebles of the word.
what i was thinking is if i got the recognized phonems, i will write some mapping method (string manuplation)and display the equlivalent amharic character. so what i want is the recognized phenomes( in string format( pronauncation key), not in audio) befor the engine compares it with the english dictionary or before the engine make any assumssion about the word. So if you know any interface or class that can extract the phonemes in SAPI please let me know. and let me try it . . . . I will be expecting your post...
|
|
|
|
|
I'm not aware of any possibility to get to the phonemes in SAPI _before_ the dictionary comparison. Sorry.
I'm not sure if it's possible to make an empty lexicon for SAPI. This would remove the comparison with English. There seems to be no available editor for the .lxa files...
Maybe this guy from Microsoft can help you: http://blogs.msdn.com/robch/[^]
It's at least worth a try
These guys here built an engine for Tamil:http://www.infitt.org/ti2004/papers/17ArunThilak.pdf[^]
They might also be able to give you some tips.
Other than that, Dragon Naturally Speaking Professional (not sure about the cheaper "Preferred" version) allows you to create a user profile with an empty vocabulary which you could fill yourself with latin alphabet transcriptions of Amharic words. That is the closest thing I can think of to get directly to the phonemes. Their engine is pretty ok at understanding words from different languages at the same time (adding French and German words to the English vocabulary is at least no problem), but you are probably looking for something with a smaller price tag attached...
|
|
|
|
|
Hi,
Why Multiple Inheritance is not supported in c#....
|
|
|
|
|
|
Sadly, the intelligence of people hoping to make a career in software is plummeting. Just look at the people who ask the most basic questions here because they are too dumb to use google or buy a book. Multiple inheritance is one of the many things C# does not support because the design team were more scared of confusing people than of creating a feature poor language.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Because the designers of the language don't trust us.
Edit: Some language designers would look at existing cars, decide that accelerators cause some people trouble, and design a car without one.
modified on Thursday, November 12, 2009 3:55 PM
|
|
|
|
|
This was a design decision. A properly designed class hierarchy (+ Interface) will allow you to achieve what you can achieve using multiple inheritance.
|
|
|
|
|
Yes... always the same solution "the language don't do it, but you can, doing a lot of code, achieve the same result."
For example, how can you implement "multiple inheritance":
Instead of creating class A and B, which are the base classes of C
(C: A, B) you create IA and IB.
There are the classes A and B, but you only reference them as IA and IB.
So, you create class C: IA, IB
Where all methods of IA call A methods and IB call B methods.
If the methods are non-virtual, you can also create A Extensions and B extensions, that will add methods to IA and IB.
So you will:
Have all virtual methods of A acessible to C using IA interface.
Have all virtual methods of B acessible to C using IB interface.
Have all non-virtual methods that will be acessible in A and B using the A and B extensions methods.
Have all C exclusive methods.
So, typing "c." will list all the methods that will be available using multiple inheritance, but the work to do it will in many cases force you to search for another solution.
|
|
|
|
|
HI,
I am trying to find cpu usage or total processor time of each tab of IE. I am able to just list one main url in the list of application. I am able to list all the url using shdocvw but for that url, I am not able to find totalprocessortime and also for each cpuusage, as i am trying to find the power consumed by each url tab individually,can any body help me on it.
The code i have written is as follows:
using System;
using System.Collections.Generic;
using System.Text;
using System.Management;
using SHDocVw;
using System.Diagnostics;
//using System.ComponentModel;
//using System.Threading;
using System.Net;
using System.IO;
using System.Text.RegularExpressions;
namespace monitor_18_10
{
class Program
{
static void Main(string[] args)
{
// FileStream file1 = new FileStream("d:\\class\\log.txt", FileMode.OpenOrCreate, FileAccess.ReadWrite);
FileStream file1 = new FileStream("d:\\class\\yyyn.txt", FileMode.Create, FileAccess.ReadWrite);
StreamWriter sw1 = new StreamWriter(file1);
FileStream file2 = new FileStream("d:\\class\\log4.txt", FileMode.OpenOrCreate, FileAccess.ReadWrite);
StreamWriter sw2 = new StreamWriter(file1);
Process[] allProcs = Process.GetProcesses();
foreach (Process thisProc in allProcs)
{
//if (!thisProc.HasExited)
//{
// thisProc.Refresh();
string procName = thisProc.ProcessName;
//string totproc = thisProc.TotalProcessorTime.ToString();
int procID = thisProc.Id;
// string totproc=thisProc.TotalProcessorTime.ToString();
//string su=thisProc.StartTime.ToShortTimeString ();
//string su=thisProc.StartTime.ToString ();
//string su = proctime.ToString();
string s = procID.ToString();
string ss = procName.ToString();
// string sss = totproc.ToString();
// richTextBox1.AppendText(s + "\t" + ss + "\n");
Console .WriteLine (s + "\t" + ss + "\n");
sw1.WriteLine(s + "\t" + ss + "\n");
//}
}
sw1.WriteLine("-------------------------------------------------");
Console.WriteLine("-------------------------------------------------");
foreach (Process p in Process.GetProcesses("."))
{
try
//{do
{
// if(!p.HasExited )
// {
// p.Refresh ();
if (p.MainWindowTitle.Length > 0)
{
Console.Write("");
string s2;
string s3;
string pt;
s2 = p.MainWindowTitle.ToString();
s3 = p.StartTime.ToString();
pt = p.TotalProcessorTime.ToString();
//richTextBox2.AppendText(s2 + "\t" + s3 + "\t" + pt + "\n\n\n");
//richTextBox4.AppendText(s3 + "\n\n\n");
Console .WriteLine (s2 + "\t" + s3 + "\t" + pt + "\n");
Console.WriteLine(s3 + "\n\n\n");
sw1.WriteLine(s2 + "\t\t\t" + s3 + "\t\t\t" + pt + "\n\n\n");
//sw1.WriteLine(s3 + "\n\n\n");
//}
}
//} while (!p.WaitForExit(1000));
}
catch { }
}
Console.WriteLine("-------------------------------------------------");
sw1.WriteLine("-------------------------------------------------");
/// cpu usage of each processes
foreach (Process proc in Process.GetProcesses())
{
using (PerformanceCounter pcProcess = new PerformanceCounter("Process", "% Processor Time", proc.ProcessName))
{
pcProcess.NextValue();
//System.Threading.Thread.Sleep(1000);
// Console.WriteLine("Process:{0} CPU% {1}", proc.ProcessName, pcProcess.NextValue());
string cpuname = proc.ProcessName.ToString();
string pcprocess = (pcProcess.NextValue() / 100).ToString();
//richTextBox5.AppendText(cpuname + "\t" + pcprocess + "\n");
Console.WriteLine(cpuname + "\t" + pcprocess + "\n");
sw1.WriteLine(cpuname + "\t" + pcprocess + "\n");
}
}
Console.WriteLine("-------------------------------------------------");
sw1.WriteLine("-------------------------------------------------");
///reading excel data
///
StreamReader SR;
string S;
int i = 0;
SR = File.OpenText(@"d:\\class\\WR111.xls");
S = SR.ReadToEnd();
SR.Close();
Console.WriteLine(S);
string[] words = S.Split(';');
Array.Sort(words);
for (i = 0; i < words.Length; i++)
Console.WriteLine(words[i]);
//this will create the archive
//StreamWriter SW;
//SW = File.CreateText(@"d:\\class\\data2.txt");
for (i = 0; i < words.Length; i++)
sw1.WriteLine(words[i]);
//SW.Close();
//reading excel data ends here
/// cpu usage ends here
// --------------------------------------------------------------------
// List of application processes
// --------------------------------------------------------------------
string processName;
ShellWindows SW = new ShellWindowsClass();
foreach (SHDocVw.WebBrowser IE in SW)
{
processName = System.IO.Path.GetFileNameWithoutExtension(IE.FullName).ToLower();
string s4 = processName;
//Console.WriteLine(processName);
sw1.WriteLine(processName);
if (processName.Equals("iexplore"))
{
string s5 = IE.LocationURL.ToString();
sw1.WriteLine(s5);
Console.WriteLine(IE.LocationURL);
sw1.WriteLine(IE.LocationURL);
String s1 = ReadUrl(IE.LocationURL);
//richTextBox3.AppendText(IE.LocationURL + "\n");
Console.WriteLine(IE.LocationURL + "\n");
sw1.WriteLine(IE.LocationURL + "hello"+"\n");
Console.WriteLine("hi y this stupid is not running");
sw1.WriteLine(IE.LocationURL + "\n");
sw1.WriteLine("hi y this stupid is not running");
sw2.WriteLine(IE.LocationURL + "\n");
//Console.WriteLine(s1);
bool m;
if (m = s1.Contains(".aac"))
//Console.WriteLine("it contains audio");
sw1.WriteLine("it contains audio");
else if (m = s1.Contains(".aif"))
sw1.WriteLine("it contains audio");
else if (m = s1.Contains(".iff"))
sw1.WriteLine("it contains audio");
else if (m = s1.Contains(".m3u"))
sw1.WriteLine("it contains audio");
else if (m = s1.Contains(".mid"))
sw1.WriteLine("it contains audio");
else if (m = s1.Contains(".midi"))
sw1.WriteLine("it contains audio");
else if (m = s1.Contains(".mp3"))
sw1.WriteLine("it contains audio");
else if (m = s1.Contains(".mpa"))
sw1.WriteLine("it contains audio");
else if (m = s1.Contains(".wav"))
sw1.WriteLine("it contains audio");
else if (m = s1.Contains(".wma"))
sw1.WriteLine("it contains audio");
else if (m = s1.Contains(".3g2"))
sw1.WriteLine("it contains video");
else if (m = s1.Contains(".3gp"))
sw1.WriteLine("it contains video");
else if (m = s1.Contains(".asf"))
sw1.WriteLine("it contains video");
else if (m = s1.Contains(".asx"))
sw1.WriteLine("it contains video");
else if (m = s1.Contains(".avi"))
sw1.WriteLine("it contains video");
else if (m = s1.Contains(".flv"))
sw1.WriteLine("it contains video");
else if (m = s1.Contains(".mkv"))
sw1.WriteLine("it contains video");
else if (m = s1.Contains(".mov"))
sw1.WriteLine("it contains video");
else if (m = s1.Contains(".mp4"))
sw1.WriteLine("it contains video");
else if (m = s1.Contains(".mpg"))
sw1.WriteLine("it contains video");
else if (m = s1.Contains(".qt"))
sw1.WriteLine("it contains video");
else if (m = s1.Contains(".rm"))
sw1.WriteLine("it contains video");
else if (m = s1.Contains(".swf"))
sw1.WriteLine("it contains video");
else if (m = s1.Contains(".vob"))
sw1.WriteLine("it contains video");
else if (m = s1.Contains(".wmv"))
sw1.WriteLine("it contains video");
else
sw1.WriteLine("no audio or video in the file");
string type = ExtractApplicationType(s1);
if (type.CompareTo("vedio") == 0)
{
sw1.WriteLine("Running Vedio application");
}
else
{
sw1.WriteLine("Running text application");
}
}
//this.Refresh();
}
//reading data from the meter
//readexceldata();
sw1.Close();
}
static string ReadUrl(string url)
{
//FileStream file2 = new FileStream("d:\\class\\log2.txt", FileMode.OpenOrCreate, FileAccess.ReadWrite);
//StreamWriter sw2 = new StreamWriter(file2);
Uri uri = new Uri(url);
//sw2.WriteLine("hi");
//sw2.WriteLine(url);
//Create the request object
WebRequest req = WebRequest.Create(uri);
WebResponse resp = req.GetResponse();
Stream stream = resp.GetResponseStream();
StreamReader sr = new StreamReader(stream);
string sss = sr.ReadToEnd();
//string sss = uri.ToString();
return (sss);
}
//public static void readexceldata()
// {
// StreamReader SR;
// string S;
// int i = 0;
// SR = File.OpenText(@"d:\\class\\WR111.xls");
// S = SR.ReadToEnd();
// SR.Close();
// Console.WriteLine(S);
// string[] words = S.Split(';');
// Array.Sort(words);
// for (i = 0; i < words.Length; i++)
// Console.WriteLine(words[i]);
// //this will create the archive
// StreamWriter SW;
// SW = File.AppendText(@"d:\\class\\yyy.txt");
// for (i = 0; i < words.Length; i++)
// SW.WriteLine(words[i]);
// SW.Close();
// }
static string ExtractApplicationType(string s)
{
// Line like: "Last</TD><TD ALIGN=RIGHT NOWRAP><B> 78 3/16"
// Line Like embed src
string sPattern = "application/x-shockwave-flash";
if (System.Text.RegularExpressions.Regex.IsMatch(s, sPattern, System.Text.RegularExpressions.RegexOptions.IgnoreCase))
{
// richTextBox3.AppendText(" (match for '{0}' found)", sPattern);
return "vedio";
}
else
{
return "text";
}
// return "text";
}
}
}
Hope to get reply,
thanks in advance...
Cheers..
Namrata
Namrata
|
|
|
|
|
That is a lot of code to look at!
I may be wrong but I believe IE runs everything in one process. The tabs will therefore not show up as separate monitorable processes. That was the whole point of Google Chrome, which is supposedly unique in running each tab in a separate process.
If you have knowledge, let others light their candles at it.
Margaret Fuller (1810 - 1850)
www.JacksonSoft.co.uk
|
|
|
|
|
Google chrome is the only browser that runs each tab in its own process (atleast AFAIK). IE runs all tabs in a single process. Therefore, unless IE provides an interface for you to do it, this is not possible.
|
|
|
|
|
Hello everybody in this forum
when i encode non ascii characters in post method in http using HTTPUtility.URLEncode in C# it gives me an output of encoded string but when i encode the same word in php using urlencode function it gives me a different output
in php it is almost the half encoded string from the one from C# output.
the word that is encoded is : السلام عليكم
in C#
======
%d8%a7%d9%84%d8%b3%d9%84%d8%a7%d9%85+%d8%b9%d9%84%d9%8a%d9%83%d9%85
in php :
========
%C7%E1%D3%E1%C7%E3%20%DA%E1%ED%DF%E3
Almost the half string in php output
i need to output in C# the same encoded string as the output from php
i don't know how to make it
Human knowledge belongs to the world.
|
|
|
|
|
Actually if there is some unicode, the querystring sometimes bigger than what needed. I dont know what is happening inside urlencode of PHP. Perhaps it should be doing the same thing, but using some other Charset.
|
|
|
|
|
.NET String datatype is Unicode. I do not have much knowledge about php, perhaps it is not Unicode. That explains why it is half the size of its C# counterpart.
|
|
|
|
|
Your C# string has 12 bytes, a plus, and 10 bytes.
Your PHP string has 6 bytes, a space, and 5 bytes.
Hence in PHP you're using a special character set, capable of representing all required chars as a single byte; whereas in C# you're using two bytes per char.
Suggestion: find out what the character set ("codepage") is you need, then use new Encoding(codepage) and its GetBytes() method.
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
|
|
|
|
|
I need to write a .NET application that captures screenshots of various web pages periodically. The application needs to run as a windows service in unattended mode - when there is no user session or when the workstation is locked. A situation similar to: (http://stackoverflow.com/questions/1445788/c-screenshot-of-process-under-windows-service), only, I need to do this on web pages rather than processes.
When I try to use PrintWindow API, I am able to capture inactive or hidden windows, but get a black image when the workstation is locked. Tried this approach (www.devnewsgroups.net/group/microsoft.public.dotnet.framework.windowsforms/topic34231.aspx) but doesn't work.
I know this is possible since there are apps like WebShot (www.websitescreenshots.com) that are able to do it - capture screenshots of web pages even when the workstation is locked or when it runs as a service.
What am I missing? How do I get this to work?
More on my approach - I'm using the .NET WebBrowser control created programmatically. I load the webpage in the browser control and capture the image from it using the PrintWindow API. This I'm able to do whether the control is visible or not, but it trips me up when the workstation is locked.
Thanks much for your time.
|
|
|
|
|
It would be easier if you do it using printscreen.
You can anytime use Graphics.CopyFromScreen(..) to get screenshot programmatically and store it using Bitmap class.
You can easily open program for a second and take the screenshot .
But The main concern is how to do this without actually loading the page, or to do this without showing it in the desktop.
No Idea on this. Hopefully someone else might answer on this.
But for the time being, this might be your solution. If not, please let me know.
|
|
|
|
|
I can only think of one solution, and it is a lot of work. You parse the URL, instead painting to screen, you just save it to image file. I doubt it is possible to make screen shot of a window, while system is locked
|
|
|
|
|
Yes Saksida...
You are right. Just for curiosity, I did this and found the program errors out if I try to take screen shot of a window while system is locked.
It produces System.ComponentModel.Win32Exception - "The handle is invalid" on g.CopyFromScreen call.
|
|
|
|
|
Hi,
Please let me know where can i find the diff b/w c# and c++
|
|
|
|
|