txt to video

powershell code

1
2
$Sentence = "Who are you"
(new-object -com SAPI.SpVoice).speak("$Sentence")

c# code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
using System;
using SpeechLib;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{ public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
SpVoice voice = new SpVoice();
voice.Speak(textBox1.Text);
}
}
}