.:: Jasa Membuat Aplikasi Website,Desktop,Android Order Now..!! | | Order Now..!! Jasa Membuat Project Arduino,Robotic,Print 3D ::.

VB.NET :: Text to speech

0 komentar


بِسْــــــــــــــــمِ اﷲِالرَّحْمَنِ اارَّحِيم
bismillaahirrahmaanirrahiim

السَّلاَمُ عَلَيْكُمْ وَرَحْمَةُ اللهِ وَبَرَكَاتُهُ
Assalamu'alaikum warahmatullahi wabarakatuh


Introduction

This code is an introduction on how to use the new System.Speech class in the .NET Framework v3.0 and v3.5. The sample source code includes an application and the source code is provided in all three .NET languages (VB, C++, C#). It is a simple Windows application and shows how to use text to speech and how to export the speech to a WAV file. The source code was written in Visual Studio 2008 using .NET 3.5.

The Code

Namespaces

First, we need to reference the System.Speech assembly from the application. From the Project menu, choose Add Reference. The from the .NET tab, highlight System.Speech and choose OK.
Then add a simple namespace import to your class file (the Form file).
// C#
using System.Speech.Synthesis;
// C++
using namespace System::Speech::Synthesis;
' VB
Imports System.Speech.Synthesis

Declarations

Next, we need to declare and instantiate a speech object. The class isSystem.Speech.Synthesis.Speechsynthesizer. This one class has enough properties and methods to speak a string using the default language and voice of the OS. In Microsoft Windows Vista, the default voice is Microsoft Ana. For Windows XP, it's Microsoft Sam. You can install additional voices, but I'll leave that to another article.
// C#
SpeechSynthesizer speaker = new SpeechSynthesizer();
// C++
public: SpeechSynthesizer speaker;
' VB
Dim speaker as New SpeechSynthesizer()

Usage

Finally, we call the Speak or SpeakAsync method of the object passing in a string containing the text we want spoken.
// C#
speaker.Rate = 1;
speaker.Volume = 100;
speaker.Speak("Hello world.");
// C++
speaker.Rate = 1;
speaker.Volume = 100;
speaker.Speak("Hello world.");
' VB
speaker.Rate = 1
speaker.Volume = 100
speaker.Speak("Hello world".)
You can see from the image that I have also included settings for speaking rate and volume. The sample programs also include code for saving the spoken string to a WAV file. Then you can set your system's sounds to the WAV files you create and your computer will sound like Dr. Falkan's. Would you like to play a game?
// CS
speaker.SetOutputToWaveFile("c:\soundfile.wav");
speaker.Speak("Hellow world.");
speaker.SetOutputToDefaultAudioDevice();
//Must remember to reset out device or the next call to speak
//will try to write to a file
// C++
speaker.SetOutputToWaveFile("c:\soundfile.wav");
speaker.Speak("Hellow world.");
speaker.SetOutputToDefaultAudioDevice();
//Must remember to reset out device or the next call to speak
//will try to write to a file
' VB
speaker.SetOutputToWaveFile("c:\soundfile.wav")
speaker.Speak("Hellow world.")
speaker.SetOutputToDefaultAudioDevice()
'Must remember to reset out device or the next call to speak
'will try to write to a file



Update Contact :
No Wa/Telepon (puat) : 085267792168
No Wa/Telepon (fajar) : 085369237896
Email : Fajarudinsidik@gmail.com
NB :: Bila Sobat tertarik Ingin membuat software, membeli software, membeli source code, membeli hardware elektronika untuk kepentingan Perusahaan maupun Tugas Akhir (TA/SKRIPSI), Insyaallah Saya siap membantu, untuk Respon Cepat dapat menghubungi kami, melalui :

No Wa/Telepon (puat) : 085267792168
No Wa/Telepon (fajar) : 085369237896
Email: Fajarudinsidik@gmail.com


atau Kirimkan Private messanger melalui email dengan klik tombol order dibawah ini :

ٱلْحَمْدُ لِلَّهِ رَبِّ ٱلْعَٰلَمِين
Alhamdulilah hirobil alamin

وَ السَّلاَمُ عَلَيْكُمْ وَرَحْمَةُ اللهِ وَبَرَكَاتُهُ
wassalamualaikum warahmatullahi wabarakatuh


Artikel VB.NET :: Text to speech, Diterbitkan oleh scodeaplikasi pada Jumat, 29 Juli 2016. Semoga artikel ini dapat menambah wawasan Anda. Website ini dipost dari beberapa sumber, bisa cek disini sumber, Sobat diperbolehkan mengcopy paste / menyebar luaskan artikel ini, karena segala yang dipost di public adalah milik public. Bila Sobat tertarik Ingin membuat software, membeli software, membeli source code ,Dengan Cara menghubungi saya Ke Email: Fajarudinsidik@gmail.com, atau No Hp/WA : (fajar) : 085369237896, (puat) : 085267792168.

Tawk.to