Click here to Skip to main content
15,877,384 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
i m new in programming i search a code which convert a sentense but not song mean small in length kindly send me code where english wave file saved in pc convert to text???????????? please help me..........
Posted
Comments
Rahul VB 28-Jan-14 13:22pm    
Do you want to convert a sound signal to a text? what do you want? question is obscure
ch.haya 29-Jan-14 7:57am    
actually my project is to read sound wave from the currently playing video and convert them to text

You're "new in programming" and you want us to give you code for some significant application?
It doesn't work that way here.
You're expected to try to learn the appropriate programming skills for the problem you are attempting to solve.
Then you should actually write some code to solve the problem.
At that point, if you have specific difficulties with your code, you can come back and ask for help with those.
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 29-Jan-14 12:51pm    
Of course, a 5.
—SA
Hello friend,
I agree with what Matt has said. With this approach you will always remain new in programming. It is the experience which counts. Its your first assignment. You need to start reading about how to play a media file in windows : go through this article first:

Playing .wav files using C#[^]


Your approach should be :

1) First i will play a sound file.(For this read the article above).
2) Now i should try to manuplate the properties of the sound clip.
Read about sampling(convert analog signal to digital signal).
3) Read about how to process each and every sample. Read about quantization etc. Basically you need to know

Quote:
Digital Signal Processing
and how to relate it with C#.


Start writing some code. Let us first see what difficulties are you facing? Here on code project we dont design algorithms for you... may be in some cases you might get a pseudo code or something, but you need to work it out alone.

If we design your algorithms and write codes for you, then you will be deprived of the knowledge which awaits you. Embrace the hard ships which you will be facing. Instead of panicking start reading.

I hope our messages have narrowed down your problems a bit. On code project we rectify faults in a code and not write an entire code. My words may be sounding harsh but its for your own good, my friend. I apologize if you are hurt, but this is the truth.

Write a code and post it, we will work together to make it work.


Thanks
 
Share this answer
 
Comments
Matt T Heffron 28-Jan-14 14:10pm    
+5
Rahul VB 28-Jan-14 14:19pm    
Thanks Sir.
ch.haya 29-Jan-14 7:55am    
Absolutely u all r right . .After searching and writing a code i consult u that mine code is converting a sentence but not a song .
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using EllisMIS.Audio.Transcription.Microsoft;

namespace MicrosoftSpeechToTextExample
{
public partial class Form1 : Form
{
Dictation _transcriber;

public Form1()
{
InitializeComponent();

}

private void btnWavFile_Click(object sender, EventArgs e)
{
///Not sure if a .Dispose is needed at all, but threw it in there.
if (_transcriber != null)
{
_transcriber.Dispose();
}

_transcriber = new Dictation();
SetEvents();
_transcriber.Start("example.wav");

}

void _transcriber_SpeechHypothesizingEvent(object sender, System.Speech.Recognition.SpeechHypothesizedEventArgs e)
{
Console.WriteLine("Speech Recognizing: " + e.Result.Text);
}

void transcriber_SpeechRecognizedEvent(object sender, System.Speech.Recognition.SpeechRecognizedEventArgs e)
{
Console.WriteLine("Speech Recognized: " + e.Result.Text);
}

public void SetEvents()
{
_transcriber.SpeechRecognizedEvent -= new Dictation.SpeechRecognizedEventHandler(transcriber_SpeechRecognizedEvent);
_transcriber.SpeechHypothesizingEvent -= new Dictation.SpeechHypothesizingEventHandler(_transcriber_SpeechHypothesizingEvent);
_transcriber.SpeechRecognizedEvent += new Dictation.SpeechRecognizedEventHandler(transcriber_SpeechRecognizedEvent);
_transcriber.SpeechHypothesizingEvent += new Dictation.SpeechHypothesizingEventHandler(_transcriber_SpeechHypothesizingEvent);
}


using System;
using System.IO;
using System.Speech.Recognition;

namespace EllisMIS.Audio.Transcription.Microsoft
{
public class Dictation : IDisposable
{
#region Local Variables
private SpeechRecognitionEngine _speechRecognitionEngine = null;
private DictationGrammar _dictationGrammar = null;
private bool _disposed = false;
#endregion

#region Constructors

public Dictation()
{
ConstructorSetup();
}

public Dictation(DictationGrammar targetGrammar)
{
_dictationGrammar = targetGrammar;
ConstructorSetup();
}

#endregion

///
/// Start the transcriber using your default microphone.
///

public void Start()
{
_speechRecognitionEngine.SetInputToDefaultAudioDevice();
StartSetup();
}

///
/// Transcribe a .wav file
///

/// <param name="targetWavFile"></param>
public void Start(string targetWavFile)
{
if (!File.Exists(targetWavFile))
{
throw new FileNotFoundException("Specified WAV file does not exist.", "targetWavFile");
}

_speechRecognitionEngine.SetInputToWaveFile(targetWavFile);


StartSetup();
}

private void StartSetup()
{
if (_dictationGrammar == null)
{
_dictationGrammar = new DictationGrammar();
}

_speechRecognitionEngine.LoadGrammar(_dictationGrammar);
_speechRecognitionEngine.RecognizeAsync(RecognizeMode.Multiple);

_speechRecognitionEngine.SpeechRecognized -= new EventHandler<speechrecognizedeventargs>(SpeechRecognized);
_speechRecognitionEngine.SpeechHypothesized -= new EventHandler<speechhypothesizedeventargs>(SpeechHypothesizing);

_speechRecognitionEngine.Sp
Rahul VB 29-Jan-14 11:28am    
using EllisMIS.Audio.Transcription.Microsoft;

- You might be getting an error saying "EllisMIS.Audio.Transcription.Microsoft" assembly is not found.
- If not then where did you get this dll file from?
- Because here the methods from this dll are being used.

ch.haya 30-Jan-14 6:00am    
agreed but new o beginner means going to handle project 1st time ............
Here you go, once you master this part, the rest will be easy.

Pattern induction and matching in music signals[^]

The apps that are available that provide lyrics to songs do so by matching the tune to a database and search the web for the lyrics to the matched song.

I suppose it is entirely possible to extract the vocals from an audio file (Complicated) and use voice recognition to interpret the the words but wouldn't it be much easier and more accurate to just look up the lyrics?
 
Share this answer
 
Comments
Rahul VB 29-Jan-14 1:11am    
PDF downloaded, thanks for valuable information Sir.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900