Skip to content

Commit

Permalink
Fis handling of ampersands for Google
Browse files Browse the repository at this point in the history
  • Loading branch information
CaffeineAU committed Nov 9, 2016
1 parent 368e328 commit 033414d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Translator/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,5 @@
// 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("2.8.2.4")]
[assembly: AssemblyFileVersion("2.8.2.4")]
[assembly: AssemblyVersion("2.8.2.5")]
[assembly: AssemblyFileVersion("2.8.2.5")]
4 changes: 2 additions & 2 deletions Translator/Properties/Settings.settings
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@
<Setting Name="CheckForNewVersion" Provider="PortableSettingsProvider" Roaming="true" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="RecentFiles" Provider="PortableSettingsProvider" Roaming="true" Type="System.Collections.Specialized.StringCollection" Scope="User">
<Setting Name="RecentFiles" Provider="PortableSettingsProvider" Roaming="true" Type="System.Collections.Specialized.StringCollection" Scope="User">
<Value Profile="(Default)"></Value>
</Setting>
</Settings>
</Settings>
</SettingsFile>
6 changes: 3 additions & 3 deletions Translator/TTSProvider/GoogleTTSProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public override void DownloadItem(PhraseItem item, string folder)
{
using (WebClient wc = new WebClient())
{
wc.DownloadFile(String.Format("http://translate.google.com/translate_tts?ie=UTF-8&total=1&idx=0&client=tw-ob&q={0}&tl={1}", item.Phrase, SelectedVoice.Language), String.Format("{0}\\mp3\\{1}\\{2}.mp3", folder, item.Folder, item.FileName));
wc.DownloadFile(String.Format("http://translate.google.com/translate_tts?ie=UTF-8&total=1&idx=0&client=tw-ob&q={0}&tl={1}", item.Phrase.Replace("&", "%26"), SelectedVoice.Language), String.Format("{0}\\mp3\\{1}\\{2}.mp3", folder, item.Folder, item.FileName));
}
ConvertToWav(item, folder, false, new String[] { Name, SelectedVoice.Name, SelectedDiscreteSpeed, SelectedDiscreteVolume });
}).Start();
Expand All @@ -70,7 +70,7 @@ public override void DownloadAndPlayItem(PhraseItem item, string folder)
{
using (WebClient wc = new WebClient())
{
wc.DownloadFile(String.Format("http://translate.google.com/translate_tts?ie=UTF-8&total=1&idx=0&client=tw-ob&q={0}&tl={1}", item.Phrase, SelectedVoice.Language), String.Format("{0}\\mp3\\{1}\\{2}.mp3", folder, item.Folder, item.FileName));
wc.DownloadFile(String.Format("http://translate.google.com/translate_tts?ie=UTF-8&total=1&idx=0&client=tw-ob&q={0}&tl={1}", item.Phrase.Replace("&", "%26"), SelectedVoice.Language), String.Format("{0}\\mp3\\{1}\\{2}.mp3", folder, item.Folder, item.FileName));
}
ConvertToWav(item, folder, true, new String[] { Name, SelectedVoice.Name, SelectedDiscreteSpeed, SelectedDiscreteVolume });
}).Start();
Expand All @@ -86,7 +86,7 @@ public override void Play(PhraseItem item)
{
using (WebClient wc = new WebClient())
{
MainWindow.PlayAudioStream(wc.DownloadData(String.Format("http://translate.google.com/translate_tts?ie=UTF-8&total=1&idx=0&client=tw-ob&q={0}&tl={1}", item.Phrase, SelectedVoice.Language)));
MainWindow.PlayAudioStream(wc.DownloadData(String.Format("http://translate.google.com/translate_tts?ie=UTF-8&total=1&idx=0&client=tw-ob&q={0}&tl={1}", item.Phrase.Replace("&", "%26"), SelectedVoice.Language)));
}
}
}
Expand Down

0 comments on commit 033414d

Please sign in to comment.