Merge pull request #800 from opentx/dvogonen/opentx_voice_generator
Dvogonen/opentx voice generator
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
/OpenTXspeak.suo
|
||||
/bin/*
|
||||
/obj/*
|
||||
@@ -0,0 +1,8 @@
|
||||
<Application x:Class="OpenTXspeak.App"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
StartupUri="MainWindow.xaml">
|
||||
<Application.Resources>
|
||||
|
||||
</Application.Resources>
|
||||
</Application>
|
||||
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Configuration;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Windows;
|
||||
|
||||
namespace OpenTXspeak
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for App.xaml
|
||||
/// </summary>
|
||||
public partial class App : Application
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,121 @@
|
||||
<Window x:Class="OpenTXspeak.MainWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
Title="OpenTX Speaker"
|
||||
Height="480"
|
||||
MinWidth="840"
|
||||
MaxWidth="840"
|
||||
ResizeMode="CanResizeWithGrip" MinHeight="480">
|
||||
|
||||
<Grid VerticalAlignment="Stretch" >
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Grid Grid.Row="0" Grid.Column="0" VerticalAlignment="Stretch">
|
||||
<ListView Name="lvSentences"
|
||||
SelectionMode="Single"
|
||||
MouseDoubleClick="lvSentences_MouseDoubleClick"
|
||||
VerticalAlignment="Stretch"
|
||||
Margin="0, 0, 0, 10">
|
||||
<ListView.View>
|
||||
<GridView>
|
||||
<GridView.Columns>
|
||||
<GridViewColumn Header="File Name" Width="100" DisplayMemberBinding="{Binding fileName}" />
|
||||
<GridViewColumn Header="Description" Width="200" DisplayMemberBinding="{Binding description}" />
|
||||
<GridViewColumn Header="Voice" Width="200" DisplayMemberBinding="{Binding voiceString}" />
|
||||
</GridView.Columns>
|
||||
</GridView>
|
||||
</ListView.View>
|
||||
</ListView>
|
||||
</Grid>
|
||||
|
||||
<StackPanel Grid.Row="0" Grid.Column="1">
|
||||
<TextBlock Text="Language" Margin="5,0,0,0" FontSize="18" />
|
||||
|
||||
<StackPanel Orientation="Vertical" HorizontalAlignment="Left" Margin="10,0,0,0">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Label Content="Text" Width="75" />
|
||||
<ComboBox Name="cbLanguages"
|
||||
DisplayMemberPath="lName"
|
||||
SelectedValuePath="sName"
|
||||
SelectionChanged="cbLanguages_SelectionChanged"
|
||||
Width="200" Height="23" />
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Label Content="Voice" Width="75" />
|
||||
<ComboBox Height="23" Name="cbVoices" Width="200" Margin="0,0,0,0"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
|
||||
<Separator Height="5" />
|
||||
<TextBlock Text="Sentence" Margin="5,0,0,0" FontSize="18" />
|
||||
<Grid Margin="10,0,0,0" DataContext="{Binding ElementName=lvSentences, Path=SelectedItem}" Width="Auto">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="75" />
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition />
|
||||
<RowDefinition />
|
||||
<RowDefinition />
|
||||
<RowDefinition />
|
||||
<RowDefinition />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock Text="File Name" VerticalAlignment="Center" HorizontalAlignment="Left" Grid.Row="0" Grid.Column="0" Margin="0,5,0,0" />
|
||||
<TextBox Text="{Binding Path=fileName}" Grid.Row="0" Grid.Column="1" Margin=" 0,0,10,0" />
|
||||
<TextBlock Text="Description" VerticalAlignment="Center" HorizontalAlignment="Left" Grid.Row="1" Grid.Column="0" Margin="0,5,0,0" />
|
||||
<TextBox Text="{Binding Path=description}" Grid.Row="1" Grid.Column="1" Margin=" 0,0,10,0"/>
|
||||
<TextBlock Text="Sentence" Grid.Row="2" Grid.Column="0" Margin="0,5,0,0" />
|
||||
<TextBox Text="{Binding Path=voiceString}" Grid.Row="2" Grid.Column="1" Margin="0,0,10,0"/>
|
||||
</Grid>
|
||||
<StackPanel Orientation="Horizontal" Margin="0,0,0,0">
|
||||
<TextBlock Text="Voice Rate" Width="70" Margin="10,10,0,0" />
|
||||
<Slider Name="voiceRateSlider"
|
||||
Value="0"
|
||||
Minimum="-5"
|
||||
Maximum="5"
|
||||
TickPlacement="BottomRight"
|
||||
TickFrequency="1"
|
||||
IsSnapToTickEnabled="True"
|
||||
Width="170"
|
||||
Margin="10,10,10,0"/>
|
||||
<TextBlock Text="{Binding ElementName=voiceRateSlider, Path=Value}" Width="40" Margin="0,10,0,0"/>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
|
||||
<Button Content="New Sentence" Name="buttonAddItem" Click="buttonAddItem_Click" Margin="0,10,0,0" Width="140" />
|
||||
<Button Content="Play Sentence" Name="buttonPlay" Click="buttonPlay_Click" Margin="10,10,0,0" Width="140" />
|
||||
</StackPanel>
|
||||
<Separator Height="5" />
|
||||
<TextBlock Text="Voice Files" Margin="5,0,0,0" FontSize="18" />
|
||||
<StackPanel Orientation="Horizontal" >
|
||||
<TextBlock Text="Voice Rate" Width="70" Margin="10,0,0,0" />
|
||||
<Slider Name="fileRateSlider"
|
||||
Value="0"
|
||||
Minimum="-5"
|
||||
Maximum="5"
|
||||
TickPlacement="BottomRight"
|
||||
TickFrequency="1"
|
||||
IsSnapToTickEnabled="True"
|
||||
Width="170"
|
||||
Margin="10,0,10,0"/>
|
||||
<TextBlock Text="{Binding ElementName=fileRateSlider, Path=Value}" Width="40" />
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="Sample Rate" Width="70" Margin="10,10,0,0" />
|
||||
<RadioButton Content="8 KHz" Height="16" Name="rb8khz" Margin="10,10,0,0"/>
|
||||
<RadioButton Content="16 kHz" Height="16" Name="rb16khz" Margin="10,10,0,0" />
|
||||
<RadioButton Content="32 kHz" Height="16" Name="rb32khz" IsChecked="True" Margin="10,10,0,0"/>
|
||||
</StackPanel>
|
||||
<Button Content="Generate Voice Files" Name="buttonGenerate" Click="buttonSaveFiles_Click" Margin="10,10,10,0" />
|
||||
<Separator Height="5" />
|
||||
<StackPanel Width="Auto" Orientation="Horizontal">
|
||||
<TextBlock FontSize="18" Margin="55,0,55,0" VerticalAlignment="Center" MouseLeftButtonDown="InstallVoices_MouseLeftButtonDown" Cursor="Hand">Install Voices</TextBlock>
|
||||
<Image Name="openTXLogo" Height="75" Width="75" Source="/OpenTXspeak;component/icon.ico" MouseLeftButtonDown="openTXLogo_MouseLeftButtonDown" HorizontalAlignment="Right" Cursor="Hand" Margin="0,0,5,0"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Window>
|
||||
@@ -0,0 +1,216 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
using System.Speech.Synthesis;
|
||||
using System.Speech.AudioFormat;
|
||||
|
||||
namespace OpenTXspeak
|
||||
{
|
||||
public partial class MainWindow : Window
|
||||
{
|
||||
SentenceTables tables = new SentenceTables();
|
||||
Languages languages = new Languages();
|
||||
Language curLang;
|
||||
Sentences sentences = new Sentences();
|
||||
SpeechSynthesizer synth = new SpeechSynthesizer();
|
||||
int added_files = 0;
|
||||
|
||||
public MainWindow()
|
||||
{
|
||||
SplashScreen splash = new SplashScreen("speaker_logo.png");
|
||||
splash.Show(true);
|
||||
Thread.Sleep(1500);
|
||||
|
||||
InitializeComponent();
|
||||
|
||||
lvSentences.ItemsSource = sentences;
|
||||
cbLanguages.ItemsSource = languages;
|
||||
|
||||
foreach (InstalledVoice voice in synth.GetInstalledVoices())
|
||||
{
|
||||
cbVoices.Items.Add(voice.VoiceInfo.Name);
|
||||
}
|
||||
cbVoices.SelectedIndex = 0;
|
||||
|
||||
languages.Add("English", "en");
|
||||
languages.Add("Czech", "cz");
|
||||
languages.Add("German", "de");
|
||||
languages.Add("French", "fr");
|
||||
languages.Add("Italian", "it");
|
||||
languages.Add("Polish", "pl");
|
||||
languages.Add("Portuguese", "pt");
|
||||
languages.Add("Swedish", "se");
|
||||
languages.Add("Slovak", "sk");
|
||||
languages.Add("Spanish", "es");
|
||||
curLang = languages[0];
|
||||
cbLanguages.SelectedIndex = 0; // Note: Sets current langugage -> triggers loadlanguage()
|
||||
}
|
||||
|
||||
private void loadLanguage()
|
||||
{
|
||||
string[] system_strings;
|
||||
string[] other_strings;
|
||||
|
||||
try
|
||||
{
|
||||
system_strings = System.IO.File.ReadAllLines(@"SOUNDS\" + curLang.sName + @"\SYSTEM\system_sounds.txt");
|
||||
other_strings = System.IO.File.ReadAllLines(@"SOUNDS\" + curLang.sName + @"\other_sounds.txt");
|
||||
}
|
||||
catch (IOException)
|
||||
{
|
||||
system_strings = tables.default_system_strings[tables.toInt(curLang.sName)];
|
||||
other_strings = tables.default_other_strings[tables.toInt(curLang.sName)];
|
||||
}
|
||||
sentences.RemoveRange(0, sentences.Count);
|
||||
|
||||
foreach (string str in system_strings)
|
||||
sentences.Add(str);
|
||||
|
||||
sentences.Add(@";^ System Sounds ^;");
|
||||
|
||||
foreach (string str in other_strings)
|
||||
sentences.Add(str);
|
||||
|
||||
lvSentences.Items.Refresh(); // Workaround - Two way binding is better
|
||||
}
|
||||
|
||||
private void cbLanguages_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
curLang = (Language)e.AddedItems[0];
|
||||
loadLanguage();
|
||||
}
|
||||
|
||||
private void lvSentences_MouseDoubleClick(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
synth.SetOutputToDefaultAudioDevice();
|
||||
synth.Rate = (int)this.voiceRateSlider.Value;
|
||||
|
||||
if (this.lvSentences.SelectedItems.Count < 1)
|
||||
return;
|
||||
|
||||
Sentence sentence = (Sentence)this.lvSentences.SelectedItem;
|
||||
synth.SelectVoice(cbVoices.Text);
|
||||
try { synth.Speak(sentence.voiceString); }
|
||||
catch (Exception){} // Workaround - Some TTS engines crashes on destruction
|
||||
}
|
||||
|
||||
private void openTXLogo_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
AboutWindow aboutWindow = new AboutWindow();
|
||||
aboutWindow.ShowDialog();
|
||||
}
|
||||
|
||||
private void InstallVoices_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
InstallVoicesWindow installVoicesWindow = new InstallVoicesWindow();
|
||||
installVoicesWindow.ShowDialog();
|
||||
}
|
||||
|
||||
private void buttonPlay_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
lvSentences_MouseDoubleClick(sender, null);
|
||||
}
|
||||
|
||||
private void buttonAddItem_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
added_files++;
|
||||
sentences.Add(new Sentence("new_file_" + added_files.ToString() + ";New Description;New Voice Message"));
|
||||
this.lvSentences.Items.Refresh();
|
||||
this.lvSentences.SelectedIndex = this.lvSentences.Items.Count - 1;
|
||||
this.lvSentences.ScrollIntoView(this.lvSentences.SelectedItem);
|
||||
}
|
||||
|
||||
private void buttonSaveFiles_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Cursor oldCursor = this.Cursor;
|
||||
this.Cursor = Cursors.Wait;
|
||||
|
||||
synth.Rate = (int)this.fileRateSlider.Value;
|
||||
|
||||
int sampleRate = 32000;
|
||||
if ((bool)this.rb16khz.IsChecked)
|
||||
sampleRate = 16000;
|
||||
else if ((bool)this.rb8khz.IsChecked)
|
||||
sampleRate = 8000;
|
||||
|
||||
SpeechAudioFormatInfo audioFormat = new SpeechAudioFormatInfo(sampleRate, AudioBitsPerSample.Sixteen, AudioChannel.Mono);
|
||||
|
||||
System.IO.Directory.CreateDirectory(@"SOUNDS\" + curLang.sName + @"\SYSTEM");
|
||||
StreamWriter sw = File.CreateText(@"SOUNDS\" + curLang.sName + @"\SYSTEM\system_sounds.txt");
|
||||
int i;
|
||||
for (i = 0; sentences[i].fileName != ""; i++)
|
||||
{
|
||||
sw.WriteLine(sentences[i].toRaw());
|
||||
synth.SetOutputToWaveFile(@"SOUNDS\" + curLang.sName + @"\SYSTEM\" + sentences[i].fileName + ".wav", audioFormat);
|
||||
try { synth.Speak(sentences[i].voiceString); }
|
||||
catch (Exception){} // Workaround - Some TTS engines crashes on destruction
|
||||
}
|
||||
sw.Close();
|
||||
sw = File.CreateText(@"SOUNDS\" + curLang.sName + @"\other_sounds.txt");
|
||||
for (i++; i < sentences.Count; i++)
|
||||
{
|
||||
sw.WriteLine(sentences[i].toRaw());
|
||||
synth.SetOutputToWaveFile(@"SOUNDS\" + curLang.sName + @"\" + sentences[i].fileName + ".wav", audioFormat);
|
||||
try { synth.Speak(sentences[i].voiceString); }
|
||||
catch (Exception){} // Workaround - Some TTS engines crashes on destruction
|
||||
}
|
||||
sw.Close();
|
||||
synth.SetOutputToNull(); // Workaround - The synth does not release the sound file like it should
|
||||
this.Cursor = oldCursor;
|
||||
}
|
||||
}
|
||||
|
||||
public class Language
|
||||
{
|
||||
public string lName { get; set; }
|
||||
public string sName { get; set; }
|
||||
}
|
||||
|
||||
public class Languages : List<Language>
|
||||
{
|
||||
public void Add(string longer, string shorter)
|
||||
{
|
||||
this.Add(new Language { lName = longer, sName = shorter });
|
||||
}
|
||||
}
|
||||
|
||||
public class Sentence
|
||||
{
|
||||
public string fileName { get; set; }
|
||||
public string description { get; set; }
|
||||
public string voiceString { get; set; }
|
||||
|
||||
public Sentence(string rawString)
|
||||
{
|
||||
string[] words = rawString.Split(';');
|
||||
fileName = words[0].TrimStart(' ', '\"');
|
||||
description = words[1];
|
||||
voiceString = words[2].TrimEnd('\"', ',', ' ');
|
||||
}
|
||||
|
||||
public string toRaw()
|
||||
{
|
||||
return "\"" +fileName + ";" + description + ";" + voiceString + "\",";
|
||||
}
|
||||
}
|
||||
|
||||
public class Sentences : List<Sentence>
|
||||
{
|
||||
public void Add(string rawString)
|
||||
{
|
||||
this.Add(new Sentence(rawString));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,130 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
|
||||
<ProductVersion>8.0.30703</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{8143D08D-1861-42DD-A861-56B15DE42A69}</ProjectGuid>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>OpenTXspeak</RootNamespace>
|
||||
<AssemblyName>OpenTXspeak</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
<TargetFrameworkProfile>Client</TargetFrameworkProfile>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<ApplicationIcon>icon.ico</ApplicationIcon>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Speech" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="System.Xaml">
|
||||
<RequiredTargetFramework>4.0</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="WindowsBase" />
|
||||
<Reference Include="PresentationCore" />
|
||||
<Reference Include="PresentationFramework" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ApplicationDefinition Include="App.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</ApplicationDefinition>
|
||||
<Compile Include="AboutWindow.xaml.cs">
|
||||
<DependentUpon>AboutWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="App.xaml.cs">
|
||||
<DependentUpon>App.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="installvoices.xaml.cs">
|
||||
<DependentUpon>installvoices.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="sentencetables.cs" />
|
||||
<Page Include="installvoices.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="MainWindow.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Compile Include="MainWindow.xaml.cs">
|
||||
<DependentUpon>MainWindow.xaml</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Page Include="AboutWindow.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Properties\AssemblyInfo.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Properties\Settings.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
</EmbeddedResource>
|
||||
<None Include="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
</None>
|
||||
<AppDesigner Include="Properties\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="icon.ico" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="eSpeak.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="speaker_logo.png" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
@@ -0,0 +1,20 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 11.00
|
||||
# Visual C# Express 2010
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenTXspeak", "OpenTXspeak.csproj", "{8143D08D-1861-42DD-A861-56B15DE42A69}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|x86 = Debug|x86
|
||||
Release|x86 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{8143D08D-1861-42DD-A861-56B15DE42A69}.Debug|x86.ActiveCfg = Debug|x86
|
||||
{8143D08D-1861-42DD-A861-56B15DE42A69}.Debug|x86.Build.0 = Debug|x86
|
||||
{8143D08D-1861-42DD-A861-56B15DE42A69}.Release|x86.ActiveCfg = Release|x86
|
||||
{8143D08D-1861-42DD-A861-56B15DE42A69}.Release|x86.Build.0 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@@ -0,0 +1,55 @@
|
||||
using System.Reflection;
|
||||
using System.Resources;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Windows;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("OpenTX Speaker")]
|
||||
[assembly: AssemblyDescription("This application is used to edit OpenTX voice strings and generate audio files for use in the FrSky Taranis radio.")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("Kjell Kernen")]
|
||||
[assembly: AssemblyProduct("OpenTX Speaker")]
|
||||
[assembly: AssemblyCopyright("Copyright © The OpenTX Team 2014")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
//In order to begin building localizable applications, set
|
||||
//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file
|
||||
//inside a <PropertyGroup>. For example, if you are using US english
|
||||
//in your source files, set the <UICulture> to en-US. Then uncomment
|
||||
//the NeutralResourceLanguage attribute below. Update the "en-US" in
|
||||
//the line below to match the UICulture setting in the project file.
|
||||
|
||||
//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
|
||||
|
||||
|
||||
[assembly: ThemeInfo(
|
||||
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
|
||||
//(used if a resource is not found in the page,
|
||||
// or application resource dictionaries)
|
||||
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
|
||||
//(used if a resource is not found in the page,
|
||||
// app, or any theme specific resource dictionaries)
|
||||
)]
|
||||
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.1")]
|
||||
[assembly: AssemblyFileVersion("1.1")]
|
||||
Generated
+71
@@ -0,0 +1,71 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.18444
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace OpenTXspeak.Properties
|
||||
{
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// A strongly-typed resource class, for looking up localized strings, etc.
|
||||
/// </summary>
|
||||
// This class was auto-generated by the StronglyTypedResourceBuilder
|
||||
// class via a tool like ResGen or Visual Studio.
|
||||
// To add or remove a member, edit your .ResX file then rerun ResGen
|
||||
// with the /str option, or rebuild your VS project.
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class Resources
|
||||
{
|
||||
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal Resources()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the cached ResourceManager instance used by this class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Resources.ResourceManager ResourceManager
|
||||
{
|
||||
get
|
||||
{
|
||||
if ((resourceMan == null))
|
||||
{
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("OpenTXspeak.Properties.Resources", typeof(Resources).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Overrides the current thread's CurrentUICulture property for all
|
||||
/// resource lookups using this strongly typed resource class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture
|
||||
{
|
||||
get
|
||||
{
|
||||
return resourceCulture;
|
||||
}
|
||||
set
|
||||
{
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,117 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
Generated
+30
@@ -0,0 +1,30 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.18444
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace OpenTXspeak.Properties
|
||||
{
|
||||
|
||||
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")]
|
||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
|
||||
{
|
||||
|
||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||
|
||||
public static Settings Default
|
||||
{
|
||||
get
|
||||
{
|
||||
return defaultInstance;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<SettingsFile xmlns="uri:settings" CurrentProfile="(Default)">
|
||||
<Profiles>
|
||||
<Profile Name="(Default)" />
|
||||
</Profiles>
|
||||
<Settings />
|
||||
</SettingsFile>
|
||||
@@ -0,0 +1,27 @@
|
||||
<Window x:Class="OpenTXspeak.AboutWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
Title="OpenTX About Window" Height="241" Width="330" Icon="/OpenTXspeak;component/icon.ico" Background="Gray">
|
||||
<Grid>
|
||||
<StackPanel>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Label Content="Product:" Foreground="White">
|
||||
</Label>
|
||||
<Label Content="Product Name" Name="lblProductName" Foreground="White"/>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Label Content="Version:" Foreground="White"/>
|
||||
<Label Content="Version" Name="lblVersion" Foreground="White"/>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Label Content="Author:" Foreground="White"/>
|
||||
<Label Content="Author:" Name="lblCompanyName" Foreground="White"/>
|
||||
</StackPanel>
|
||||
<Label Content="Copyright" Name="lblCopyright" Foreground="White"/>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="TextBlock" Name="description" Height="88" Margin="5,5,10,0" TextWrapping="Wrap" Width="200" Foreground="White"/>
|
||||
<Image Source="/OpenTXspeak;component/icon.ico" Stretch="Uniform" Height="90" Width="90" />
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Window>
|
||||
@@ -0,0 +1,39 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace OpenTXspeak
|
||||
{
|
||||
public partial class AboutWindow : Window
|
||||
{
|
||||
public AboutWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
Assembly app = Assembly.GetExecutingAssembly();
|
||||
|
||||
AssemblyTitleAttribute title = (AssemblyTitleAttribute)app.GetCustomAttributes(typeof(AssemblyTitleAttribute), false)[0];
|
||||
AssemblyProductAttribute product = (AssemblyProductAttribute)app.GetCustomAttributes(typeof(AssemblyProductAttribute), false)[0];
|
||||
AssemblyCopyrightAttribute copyright = (AssemblyCopyrightAttribute)app.GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false)[0];
|
||||
AssemblyCompanyAttribute company = (AssemblyCompanyAttribute)app.GetCustomAttributes(typeof(AssemblyCompanyAttribute), false)[0];
|
||||
AssemblyDescriptionAttribute description = (AssemblyDescriptionAttribute)app.GetCustomAttributes(typeof(AssemblyDescriptionAttribute), false)[0];
|
||||
Version version = app.GetName().Version;
|
||||
|
||||
this.Title = String.Format("About {0}", title.Title);
|
||||
this.lblProductName.Content = product.Product;
|
||||
this.lblVersion.Content = String.Format("Version {0}", version.ToString());
|
||||
this.lblCopyright.Content = copyright.Copyright.ToString();
|
||||
this.lblCompanyName.Content = company.Company;
|
||||
this.description.Text = description.Description;
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.8 KiB |
Binary file not shown.
Binary file not shown.
|
After Width: | Height: | Size: 78 KiB |
@@ -0,0 +1,24 @@
|
||||
<Window x:Class="OpenTXspeak.InstallVoicesWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
Title="Install Additional Voices" Height="269" Width="504">
|
||||
<Grid>
|
||||
<StackPanel Orientation="Vertical" >
|
||||
<TextBlock Margin="5,5,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" TextWrapping="Wrap"
|
||||
Text="The English default voice (Microsoft Anna) is quite good. Microsoft does however not provide free voices for all languages. If there is no voice available for your language, you must install one on your own. Any MS SAPI voice should work."/>
|
||||
<TextBlock Margin="5,5,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" TextWrapping="Wrap"
|
||||
Text="Use the phrases SAPI and TTS to search for voices. TTS is the general term for synthetic speech and SAPI is Microsoft's voice interface." />
|
||||
<TextBlock Margin="5,5,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" TextWrapping="Wrap"
|
||||
Text="There are several commercial alternatives available. These are high quility, but also expensive. There are also free open source alternatives. The downside to these is that the voices sound robotic. But they are clearly understandable." />
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Margin="5,5,10,0" Width="370" HorizontalAlignment="Left" VerticalAlignment="Top" TextWrapping="Wrap"
|
||||
Text="The author of this application used the free eSpeak voices to test voice generation. Many languages are supported. Click the image on the right to go to eSpeaks project page. There you can find out if your language is supported and download the voice package." />
|
||||
<TextBlock>
|
||||
<Hyperlink NavigateUri="http://espeak.sourceforge.net/" RequestNavigate="Hyperlink_RequestNavigate">
|
||||
<Image Stretch="None" Source="/OpenTXspeak;component/eSpeak.png" Cursor="Hand" />
|
||||
</Hyperlink>
|
||||
</TextBlock>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Window>
|
||||
@@ -0,0 +1,37 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Shapes;
|
||||
using System.Windows.Navigation;
|
||||
|
||||
|
||||
|
||||
namespace OpenTXspeak
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for installvoices.xaml
|
||||
/// </summary>
|
||||
public partial class InstallVoicesWindow : Window
|
||||
{
|
||||
public InstallVoicesWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void Hyperlink_RequestNavigate(object sender, RequestNavigateEventArgs e)
|
||||
{
|
||||
Process.Start(new ProcessStartInfo(e.Uri.AbsoluteUri));
|
||||
e.Handled = true;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
Binary file not shown.
|
After Width: | Height: | Size: 16 KiB |
Binary file not shown.
Reference in New Issue
Block a user