How To Convert An Audio File To A Text in VB
How To Convert An Audio File To A Text in VB
Text In VB.Net
By
janobe
-
October 7, 2015
2
960
Share on Facebook
Tweet on Twitter
In this tutorial I will show how to convert an audio file into a text by
using Visual Basic 2008. This method helps you, how to recognize the content
of your audio file. For instance, if the audio file cannot be heard or cannot be
understood. It will be recognized, because the content of your audio file will
appear in the Box through text.
Let’s begin:
Open the Visual Basic 2008, create a new Windows Application and drag a
RichTextBox, TextBox and the Button. Then do the Form just like this.
After that, double click the Form and do the following code for your imports.
VB.NET
1. Imports System
2. Imports System.Collections.Generic
3. Imports System.ComponentModel
4. Imports System.Data
5. Imports System.Drawing
6. Imports System.Text
7. Imports System.Windows.Forms
8. Imports System.Diagnostics
9. Imports SpeechLib
VB.NET
1. 'SET THE SPEECH RECOGNIZER
2. Dim s_recognizer As SpInprocRecognizer
3. 'SET THE GRAMMAR RECOGNIZER
4. Dim s_grammar As ISpeechRecoGrammar
5. 'SET THE FILE STREAM CONTAINING THE SPEECH
6. Dim s_fileStream As SpFileStream
7. 'SET THE CONTEXT RECOGNIZER
8. Dim WithEvents speech_RecoContext As SpInProcRecoContext
After that, create a sub procedure for recognizing the audio file.
VB.NET
VB.NET
After that, create a sub procedure to be called once after the entire file was
analyzed.
VB.NET