You can test it out here: [U]http://www.kirupafx.com/ItSpeaks/publish.htm[/U] ([URL=“https://addons.mozilla.org/firefox/addon/1608”]FFClickOnce if you are running FF). Btw, the application does not require .NET 3.5. Version 3.0 is good enough:
The code is pretty straightforward. The XAML is:
<Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d"
x:Class="ItSpeaks.Window1"
x:Name="Window"
Title="Speech Synthesizer"
Width="361" Height="159" Icon="sound.png" ResizeMode="NoResize">
<Window.Background>
<LinearGradientBrush EndPoint="0.5,0.975" StartPoint="0.5,0.025">
<GradientStop Color="#FF0D3743" Offset="0"/>
<GradientStop Color="#FF8CD0F0" Offset="1"/>
</LinearGradientBrush>
</Window.Background>
<Grid x:Name="LayoutRoot">
<TextBox Margin="33,52,93.447,49.04" x:Name="whatToSay" Text="" TextWrapping="Wrap" d:LayoutOverrides="Height" FontSize="18" FontWeight="Bold"/>
<Button HorizontalAlignment="Right" Margin="0,52,15.377,49.04" x:Name="SpeakNow" Content="Speak" Click="Speak" d:LayoutOverrides="Height" Width="67.773" IsDefault="True"/>
<Label HorizontalAlignment="Left" Margin="8,17,0,0" VerticalAlignment="Top" Width="97" Height="29" Content="what to say:" FontSize="14" FontWeight="Bold" Foreground="#FFE4E4E4"/>
</Grid>
</Window>
And the C# is:
using System;
using System.IO;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Navigation;
using System.Speech.Synthesis;
namespace ItSpeaks
{
public partial class Window1
{
private SpeechSynthesizer foo;
public Window1()
{
this.InitializeComponent();
// Insert code required on object creation below this point.
foo = new SpeechSynthesizer();
}
private void Speak(object sender, System.Windows.RoutedEventArgs e)
{
// Speak
foo.SpeakAsync(whatToSay.Text);
// 0 to 100
foo.Volume = 100;
// -10 to 10
foo.Rate = -2;
}
}
}
[SIZE=2]There is also a voice-to-text engine, so I might give that a shot later.[/SIZE]
[SIZE=2] [/SIZE]