.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Wave to Text - Need help with custom grammar

Posted By:      Posted Date: September 09, 2010    Points: 0   Category :WPF
I created a wav to text conversion using a ISpeechRecoContext and it works, but it is not precised. I was hopping to add a custom grammar to it but im not sure how to. Any ideas? Here is a WPF MainWindow.xaml.cs using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; using Microsoft.Win32; using SpeechLib; namespace WaveToText { public partial class MainWindow : Window { private ISpeechRecoContext WaveRecognizer = null; private SpFileStream InputWAV = null; private ISpeechRecoGrammar Grammar = null; public MainWindow() { InitializeComponent(); } private void ExitButtonClick(object sender, RoutedEventArgs e) { this.Close(); } private void ConvertButtonClick(object sender, RoutedEventArgs e) { ResultTextBox.Text = ""; OpenFileDialog dialog = new OpenFileDialog(); dialog.Title = "Select a Speech file"; dialog.Filter = "Wave Files (.WAV)|*.wav"; // Filter files by extension dialog.InitialDirectory = Environment.CurrentDirectory + "\\Content"; Nullabl

View Complete Post

More Related Resource Links

Can't Get Text From Custom Wizard Step


I'm trying to get the text values from each textbox in a custom created createuserwizard step however i keep returning null for each textbox however the default step & text boxes (ie. UserName, Password, Email, etc, etc) i can get the text value with no problem



            <asp:WizardStep ID="CreateUserWizardStep0" runat="server">

custom validator firring on text changed


hi all i have a custom validator i have written a javascript method for this validator;

this validator has been pot on a textbox that has auto post back is true .... now this validation  fires when the post back happens...

i dont want it to fire on the post back but only on button click

please suggest 

thanks in advance 


Implementing custom ValidationFor to show an error icon with a tooltip instead of just text for c


I got the problem that my implementation (see source below) only shows the validation error message after server side validation an NOT

after clientside validation! My questions is, how can you extend or implement to show the validation error message also on client-side validation.

Unfortunately I have not found any other info source about this subject, so any help will be very much appreciated!

 public static string ErrorMessageFor<TModel, TProperty>(this HtmlHelper<TModel> htmlHelper, Expression<Func<TModel, TProperty>> expression)
            string modelName = htmlHelper.ViewContext.ViewData.TemplateInfo.GetFullHtmlFieldName(ExpressionHelper.GetExpressionText(expression));
            FormContext formContext = htmlHelper.ViewContext.FormContext;

            if (!htmlHelper.ViewData.ModelState.ContainsKey(modelName) && formContext == null)
                return null;

            ModelState modelState = htmlHelper.ViewData.ModelState[modelName];
            ModelErrorCollection modelErrors = (modelState == null) ? null : modelState.Errors;
            ModelError modelError = ((modelErrors == null) || (modelErrors.Count == 0)) ? null : modelErrors[0];

            if (modelError == null && formContext == null)

ASP.NET MVC2 Custom routing with wildcard or free text url


I have a requirement to add specific functionality to an asp.net mvc2 web site to provide addtional SEO capability, as follows:

The incoming URL is plain text, perhaps a containing a sentence as follows

"http://somesite.com/welcome-to-our-web-site" or "http://somesite.com/cool things/check-out-this-awesome-video"

In the MVC pipeline, I would like to take this URL, strip off the website name, look up the remaining portion in a database table and call an appropriate controller/view based on the content of the data in the table. All controllers will simply take a single parameter bieng the unique id from the lookup table. A different controller may be used depnding on different urls, but this must be derieved from the database.

If the url cannot be resolved a 404 error needs to be provided, if the url is found but obsolete then a 302 redirect needs to be provided.

Where the url is resolved it must be retained in the browser address bar.

I have had a look at the routing model, and custom routing and can't quite work out how to do it using these, as the controller would not be predefined, based on a simple route. I am also unsure of what to do to provide 404, 302 back to the headers also. Perhpas I need a custom httpmodule or similar but going there went beyond my understanding.

This must be possible someho

How can I add a SharePoint Rich text editor in my custom application page?


I want to have a richtext editor in my custom application page.

Can I use the richtext editor  bulit-in in SharePoint?

I tried add this code in my aspx but it doesn't render the control but throw a error

<SharePoint:RichTextField ID="DefaultValue" runat="server" ControlMode="New" FieldName="Title"></SharePoint:RichTextField>

Anyone helps?

Small problem with displaying custom calendar cell text from db in Safari


using VS2010

I'm using the calendar control to create a simple event calendar. I want to add a small bit of custom text just below the date of any cell that contains an event on that date.

The code:

protected void Calendar1_DayRender(object sender, DayRenderEventArgs e)
      string connString = ConfigurationManager.ConnectionStrings["CalendarConnectionString1"].ToString();
      SqlConnection myConnection = new SqlConnection(connString);
      SqlDataAdapter myAdapter = new SqlDataAdapter("GetEvents", myConnection);
      DataSet myDataSet = new DataSet();
      myAdapter.Fill(myDataSet, "Table");
      //If the month is CurrentMonth
      if (!e.Day.IsOtherMonth)
        foreach (DataRow dr in myDataSet.Tables[0].Rows)
          if ((dr["Date"].ToString() != DBNull.Value.ToString()))
            DateTime dtEvent = (DateTime)dr["Date"];
            if (dtEvent.Equals(e.Day.Date))
              e.Cell.BackColor = Color.MediumAquamarine;
              Label label = new Label();
              label.Text = "</br>";
              label.Text += dr["Title"].ToString();              

Removing standard text from custom feedback process email notification


My workflow has a Start Feedback Process action, which contains some pre-defined instructions. One of my instructions is to use a particular link to open the workflow history page – I have added this to force the user to open the form via the workflow history page (we're using Forms Services) because the email’s default link opens the form in the InfoPath client, not the browser. It also allows the user to be returned to the page where they will complete their workflow task (we're trying to make navigation as easy for them as possible).

Although I have defined my own set of instructions, the email notification I receive includes some standard text that links to the InfoPath form’s xml file. I don’t want users inadvertently clicking the “To complete this task…” link at the bottom of the email and having the form open in InfoPath. Here is an example of the email I’m referring to:


How to custom Rating Scale field to add more range text in survey on MOSS 2007


When we use the rating scacle fied to create question in survey. You can only set three range texts for each question. Is there any way to allocate a range text for each range ? Such as below :

                                 low             normal          high       important        very important

                                 1                  2                  3               4                     5

First question about ...?  


Thanks all your help !


Creating custom Intellisense-based text editor like Pex for Fun


We would like to create a custom text editor which allows our end users to enter .Net code that hooks into our .Net API with Intellisense similar to how it is done on the Pex for Fun website: http://www.pexforfun.com/

Is there a way to build a custom control text editor (or use a 3rd party free or purchased control) that supports .Net Intellisense  in the same way done by Microsoft on the Pex for Fun website?


Can you custom format a single sitemapnode based it's text, url or level (submenu)?


The title pretty much states the question.  I have a menu inside my asp.net master page.  This menu pulls from  a web.sitemap file.  I have a css file that formats the individual nodes.  However, I want to format the menu headers a certain way while the submenu's are different.  Namely, I want to put a small image before all the submenu points while not the main sitemapnodes.  So far, I can use css to put the image infront of every node.  But I haven't been able to differentiate between the nodes.  The main node has a blank URL instance.  I thought I could use that in the C# code but I haven't been able to .  Could someone give me a link or show some code on how to do this?  Thanks.

Rich text box functionalities in custom webpart


Hi All,


I have created a custom webpart with a inputformtextbox using the below code snipe:


InputFormTextBox iptFormTbx = new InputFormTextBox();

iptFormTbx.Rows = 10;

iptFormTbx.RichText = true;

iptFormTbx.RichTextMode = SPRichTextMode.FullHtml;

iptFormTbx.TextMode = TextBoxMode.MultiLine;

iptFormTbx.AllowHyperlink = true;

How do you change the width of a multiple line of text box on a custom list form?




I have a custom list that has been added using SharePoint Designer to a web part page as a custom list form (Insert - SharePoint controls.)

The list has many single lines of text and one multiple line of text.

The multiple line of text is too wide - I need to make it narrower but how?





Need Custom Text Box Control with DataSource,TableName,ColumnName Property


I need to create one custom text box control which should be bind with data base.

I am referring following link...


I used DataBoundControl to create my control but i am not able to do it properly.

    public class SimpleTextBoxControl : DataBoundControl
        private TextBox nameTextBox;

        public string DataTextField
                object o = ViewState["DataTextField"];
                return ((o == null) ? string.Empty : (string)o);

Web Part Custom Property Text Values Showing Up on Page


I've created a basic Web Part in a .wsp and defined two custom web properties.

However, whatever value I place in these text values when in the edit mode show up on the Page beneath the Web Part name.  Why?  How do I not show the value of Properties outside of the Modify Property window?

How to merge two columns data into a third column (text fields) in a custom list? is it possible to



I am wokring with MOSS 2007 environment.

In one of the sites I have a custom list which has the following columns

1. Report Title - Hyperlink

2. Description - Multiple lines

3. Created date - date


The requirement is to merge the "Report Title and Description" and show it in a third column which will be inlcuded in the custom view.

Report Title                           Decsription                                                                Created date

XYZ                           Test Report which needs to be deployed                 01/01/2011


This needs

Custom Controls in C# .NET

Embedding user controls in a Windows form is just like adding a simple button or text box that are already provided with .NET. These basic controls were written essentially like you code your own controls. Typically the controls you design are to be used in multiple forms or to modularize your code. These reasons help reduce the amount of code you have to type as well as make it easier for you to change your implementation. There should almost never be any reason to duplicate code because it leaves a lot of room for bugs. So, implementing functionality specific to your control in the control's source code is a good idea. This reduces code duplication as well as modularize your code, which is a good programming guideline.

Writing custom MembershipProvider

ASP.NET Membership mechanism allows to use the build-in server tables to store and retrieve user data. By default, this mechanism can only be used with SQL Server database to which Microsoft provides suitable MembershipProvider class.
Inheriting from this abstract class, developer can use his own table(-es) from any database and use any database engine other than SQL Server, like Oracle, DB2 etc.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend