|
You are absolutely right, I have 2 problems :
- Where to get SharpSphinx , because i have googles it , but did nto find it. It was hosted by Codeplex, but after Codeplex shutdown, it is not there, even into archive.
- alternative solution is to get PocketSphinx to work with C# , since it is un-managed code (C++), I cannot use the dll.
|
|
|
|
|
I already provided alternatives and I just validated again that they do seem to exist.
|
|
|
|
|
Hi to all.
Did anyone already work on C# wrapper for SharpSphinx or PocketSphinx for converting speech to text
Thanks.
Waleed
|
|
|
|
|
hi
modified 19-Jun-19 0:43am.
|
|
|
|
|
And?
What have you tried?
Where are you stuck?
What help do you need?
Sent from my Amstrad PC 1640
Never throw anything away, Griff
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
1. First i am trying PDF file drag and drop in the Acrobate PDF properties there is not Event for DragDrop and DragEnter.
Any opensource avaiable? in c#
|
|
|
|
|
That still tells us nothing about what you are trying to do: we have no idea what controls you are trying to use and failing with, let alone how you are trying to use them!
Remember that we can't see your screen, access your HDD, or read your mind - we only get exactly what you type to work with.
Sent from my Amstrad PC 1640
Never throw anything away, Griff
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
I am Using AcrobatPDF in the AcrobatPDF i have to drag and drop pdf file form my desktop or any other folder. once drag and drop the pdf file in the winforms. After Clicking PDF File it comes in fullscreen.
In AcrobatPDF its possible to drag n and drop PdF document
|
|
|
|
|
This has "long day" written all over it ...
What does that have to do with C#?
What controls are you using?
What - exactly - are you trying to do with them?
Please, remember that we can't see your screen, access your HDD, or read your mind - we only get exactly what you type to work with. Unless you give us information, we can't respond to it - and we have no idea what code you are trying ...
Sent from my Amstrad PC 1640
Never throw anything away, Griff
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Go to ParentI am using Windows application Web browser control
1. in my winforms i have 9 webbrowser control each web browser control load all files
eg: image, pdf, word excel
2. now in my winforms webbrowser control loading image when i drag and drop image in webbrowser1 the image size is not expand to webbrowser control window. i write this code for image expand to webbrowser control.
private void webbrowser1_DocumentCompleted(object sender,WebbrowserDocumentCompletedEventArgs e)
{
var img = webBrowser1.Document.GetElementsByTagName("img").Cast<htmlelement>().FirstOrDefault();
var w = img.ClientRectangle.Width;
var h = img.ClientRectangle.Height;
img.Style = string.Format("{0}: 100%", w > h ? "Width" : "Height");
}
after this code is expanding image in webbrowser1 control and preview full screen.
now i am trying to load pdf in Webbrowser1 show error
Object reference not set to an instance of an object.
|
|
|
|
|
Member 13706320 wrote: Object reference not set to an instance of an object.
This is one of the most common problems we get asked, and it's also the one we are least equipped to answer, but you are most equipped to answer yourself.
Let me just explain what the error means: You have tried to use a variable, property, or a method return value but it contains null - which means that there is no instance of a class in the variable.
It's a bit like a pocket: you have a pocket in your shirt, which you use to hold a pen. If you reach into the pocket and find there isn't a pen there, you can't sign your name on a piece of paper - and you will get very funny looks if you try! The empty pocket is giving you a null value (no pen here!) so you can't do anything that you would normally do once you retrieved your pen. Why is it empty? That's the question - it may be that you forgot to pick up your pen when you left the house this morning, or possibly you left the pen in the pocket of yesterdays shirt when you took it off last night.
We can't tell, because we weren't there, and even more importantly, we can't even see your shirt, much less what is in the pocket!
Back to computers, and you have done the same thing, somehow - and we can't see your code, much less run it and find out what contains null when it shouldn't.
But you can - and Visual Studio will help you here. Run your program in the debugger and when it fails, VS will show you the line it found the problem on. You can then start looking at the various parts of it to see what value is null and start looking back through your code to find out why. So put a breakpoint at the beginning of the method containing the error line, and run your program from the start again. This time, VS will stop before the error, and let you examine what is going on by stepping through the code looking at your values.
But we can't do that - we don't have your code, we don't know how to use it if we did have it, we don't have your data. So try it - and see how much information you can find out!
Sent from my Amstrad PC 1640
Never throw anything away, Griff
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
If you want to add drag & drop from Explorer, then it will work the same for any file; it's up to you whether or not to do something with the event. There's plenty examples of that in the CodeProject articles.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
Which Control will Work for Acrobat Pdf in properties there is not DragDrop Event and DragEnter
|
|
|
|
|
If you're looking for a control to automatically handle the Drag and Drop for you AND/OR display a PDF for you without any work on your part, in either case, there is no such thing.
|
|
|
|
|
Hi loaded multiple files in web browser
But when I load image , image size is not fitScale in webbrowser . But pdf drag in same webbrowser it fitScale window and preview full screen.
If I use image width and height in webbrowser then image image was fitScale in webbrowser window.
But I can’t load in same webbrowser window pdf
|
|
|
|
|
I don't have a clue what you're talking about.
You offer up no context about anything. We have no idea what kind of app you're writing (Windows Forms, WPF, ASP.NET/MVC, ...), what problem you're having, how this "web browser" and "fitScale" stuff figures into your app, ... nothing makes any sense.
|
|
|
|
|
I am using Windows application Web browser control
1. in my winforms i have 9 webbrowser control each web browser control load all files
eg: image, pdf, word excel
2. now in my winforms webbrowser control loading image when i drag and drop image in webbrowser1 the image size is not expand to webbrowser control window. i write this code for image expand to webbrowser control.
private void webbrowser1_DocumentCompleted(object sender,WebbrowserDocumentCompletedEventArgs e)
{
var img = webBrowser1.Document.GetElementsByTagName("img").Cast<htmlelement>().FirstOrDefault();
var w = img.ClientRectangle.Width;
var h = img.ClientRectangle.Height;
img.Style = string.Format("{0}: 100%", w > h ? "Width" : "Height");
}
after this code is expanding image in webbrowser1 control and preview full screen.
now i am trying to load pdf in Webbrowser1 show error
Object reference not set to an instance of an object.
|
|
|
|
|
That's because a PDF doesn't show in an IMG tag. Look at the page source HTML after the PDF loads.
|
|
|
|
|
"Which Control will Work for Acrobat Pdf in properties there is not DragDrop Event and DragEnter"
Not everything is exposed using properties. If you want to drag and drop from Shell/Explorer, then you have to start coding. Also, the type of file is not relevant; it works the same way for all files
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
I have install Shell? in Nuget? Please can share any link related Drag and Drop
|
|
|
|
|
|
Thanks will try this link and let you know
|
|
|
|
|
Weekend is approaching, and in case you may feel bored without a complicated programming task, I have a puzzle for you.
I already asked at StackOverflow: c# - Logging exceptions in fire&forget tasks - Stack Overflow[^], but did not get a usable answer.
In short, I want to create a method which takes an Action parameter, fires off a Task with it, and makes sure that exceptions do not crash the application (but logs the exception messages so that I can find out that something bad happened).
I tried following code:
public static void CreateAndStartTaskWithErrorLogging(Action _action, string _componentName, string _originalStacktrace = null)
{
DateTime started = HighPrecisionClock.Now;
Task task = new Task(_action);
task.ContinueWith(_continuation => _continuation.LogExceptions(_componentName, started, _originalStacktrace));
task.ConfigureAwait(false);
task.Start();
}
internal static void LogExceptions(this Task _t, string _componentName, DateTime _started, string _originalStacktrace = null)
{
try
{
_t.Wait(1000);
}
catch (Exception ex)
{
Logger.LogError(_componentName, $"An exception occurred in a fire-and-forget task which was started at {_started}.\r\n" +
$"The original stack trace is:\r\n{_originalStacktrace}");
Logger.LogException(_componentName, ex);
}
try
{
_t.Dispose();
}
catch (Exception dex)
{
Logger.LogException(_componentName, dex);
}
}
Well, normally, it works.
Normally.
Not always...
And then the service crashes with an error entry in the Windows Event Log.
(That's also true for the solution in the first answer at SO).
Some more background.
The application is a highly configurable Windows Service. The function is called with Utilities.TaskExtensions.CreateAndStartTaskWithErrorLogging(() => DataStore.StoreSyncedData(data), Name); , where DataStore is set to a composite which in turn calls Parallel.ForEach(m_InnerDataStores, _store => { _store.StoreSyncedData(_syncedData); }); on its members. One of them writes a video with the Accord library, which sometimes causes an AccessViolation at <Module>.avcodec_encode_video2(libffmpeg.AVCodecContext*, libffmpeg.AVPacket*, libffmpeg.AVFrame*, Int32*) , i.e. the exception may come from non-managed code. Perhaps 10% of these exceptions evade...
So my question is:
how should my function look like to catch those evading exceptions?
And extra upvotes if you can explain why my code (or the suggested solution at SO) fails.
Oh sanctissimi Wilhelmus, Theodorus, et Fredericus!
|
|
|
|
|
Thanks for raising the level of discourse
«Where is the Life we have lost in living? Where is the wisdom we have lost in knowledge? Where is the knowledge we have lost in information?» T. S. Elliot
|
|
|
|
|
Native exceptions thrown by unmanaged code that occured on a thread started by that unmanaged code can't be caught. That's most often originating from a COM-object.
Bernhard Hiller wrote: the exception may come from non-managed code. Upvote is for you, as you answered it before me
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|