Click here to Skip to main content
15,884,388 members
Please Sign up or sign in to vote.
4.50/5 (2 votes)
See more: , +
Hello!

I have a little problem in my win forms application.
The main idea was to show the spectrum/oscillator, of the out going sound of the System.Speech.
It supposed to look like this:
http://img196.imageshack.us/i/spectrump.png[^]

I've found a lot of projects but 99% of them was about playing a .wav, or recording from microphone.
This one was perfect:
Sound Activated Recorder with Spectrogram in C#[^]
It was drawing fast enough, and had exatcly what I needed, but it used the microphone as a source of audio, and I just couldn't find a way to change the source...

Now can some one explain me how to draw a spectogram of System.Speech, or even just the global playback of windows?

Thanks for any reply!
QwertyXoid.
Posted
Comments
Sergey Alexandrovich Kryukov 8-Apr-11 14:18pm    
I voted 5 for this Questions, but not for the Question itself, but because it should be an interesting project.
--SA

1 solution

You cannot use anything from System.Speech to access the raw source of the audio. There is nothing like that in the engine. Instead, you still need to use the same source of audio data to feed to the System.Speech engine (I guess, the recognizer) and to your spectrum analysis unit. What is you requirements in general terms? What are the ultimate goals of your project?

[FOLLOW-UP:]

Here is what you can do: collect the raw input voice data in the close-circle buffer with appropriate time stamps in real time. Handle the events SpeechDetected, SpeechRecognitionRejected and SpeechRecognized. Have two time stamps (of the type System.DataTime), such as StartTime and EndTime. Take a first time stamp on SpeechDetected, second time stamp on SpeechRecognitionRejected and SpeechRecognized. You can use the property AudioPosition for the timing. When the time stamp EndTime is set, use both time stamp and you audio buffer to extract the appropriate fragment of your raw data and feed it the spectrum analysis unit, present the result to the UI. That's it!

But… Just for decoration? I'm somewhat frustrated… :-)

—SA
 
Share this answer
 
v4
Comments
QwertyXoid 8-Apr-11 14:21pm    
Its a small helper, that uses Text-to-Speech to notify the user, and uses recognizer to listen to the user, and his commands.
So I hoped that its possible to show the spectrum for the part of the Text-to-Speech... To make the helper look a little more cool/techy...
Sergey Alexandrovich Kryukov 8-Apr-11 14:46pm    
Yes, of course. Is "more cool" is the main reason. I would advice you to avoid anything just for decoration and show only the functional things. I thought it's more serious.
Did you see the application which teach correct pronunciation and use the spectrum for feedback, point out comparison with perfect model spectrum, etc. That is serious!
--SA
Sergey Alexandrovich Kryukov 8-Apr-11 14:54pm    
OK, see my update.
Isn't it about the time to formally accept my Answer?.. :-)
--SA
Sergey Alexandrovich Kryukov 8-Apr-11 15:16pm    
Thank you...
Will it work for you?
Feel free to ask other questions -- I've done speech recognition. Did you face thread apartment model problem -- it needs to be resolved in some cases.
--SA
QwertyXoid 8-Apr-11 15:15pm    
I'm sorry I didnt answer your expectations :(
And also... I'm sorry that I didnt actually understood your answer :(
I understood the global logic, but I'm pretty much still basic-developer, I've started exploring C# about 6 month ago. Mostly learning from examples.
So if you got any example for me, I would be VERY glad :)

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