So this is the useful effect for building any page and if we have many entries through TextBox then to identify that which TextBox is used for what thing then we can identify it easily so let's we have to see the steps which is given below to implement such type of functionality. So the information to use a watermark effect is that it tells you for which thing the TextBox control is used and what you have to do to write inside the TextBox. If we don't write inside the TextBox control then it again shows the watermark effect as well. Further as you know about the watermark effect which means that whenever we will click on the TextBox control and it will be hidden so that we can write the text inside the TextBox control.
In this article we are going to create a watermark effect on the TextBox control from Windows Phone 7. Step 9 : Now build the application and execute it.Now it's time to create some special effects in Windows Phone 7. SoundEffect se = SoundEffect.FromStream(args.Result) Ĭlient.OpenReadAsync( new Uri(e.Result)) Void translator_SpeakCompleted( object sender, ServiceReference1.SpeakCompletedEventArgs e)Ĭlient.OpenReadCompleted += ((s, args) => PanoSpeech.DefaultItem = panoSpeech.Items ObjTranslator.SpeakAsync(AppId,, languageCode, "audio/wav") ObjTranslator.SpeakCompleted += translator_SpeakCompleted Private void btnSpeak_Click( object sender, RoutedEventArgs e) Step 8 : The second Panorama item used in development for speaking the text using the SpeakAsync method takes four string parameters like AppId, SpeechText, SpeechLanguage, format. Var codes = e.UserState as ObservableCollection Void translator_GetLanguageNamesCompleted( object sender, GetLanguageNamesCompletedEventArgs e) ObjTranslator.GetLanguageNamesAsync(AppId, "en", e.Result, e.Result) ObjTranslator.GetLanguageNamesCompleted += new EventHandler(translator_GetLanguageNamesCompleted) Var objTranslator = e.UserState as ServiceReference1.LanguageServiceClient Void translator_GetLanguagesForSpeakCompleted( object sender, GetLanguagesForSpeakCompletedEventArgs e) ObjTranslator.GetLanguagesForSpeakAsync(AppId, objTranslator) ObjTranslator.GetLanguagesForSpeakCompleted += new EventHandler(translator_GetLanguagesForSpeakCompleted) Var objTranslator = new ServiceReference1.LanguageServiceClient() Void MainPage_Loaded( object sender, RoutedEventArgs e) GetLanguagesForSpeakAsync takes two methods like AppID and object. The GetLanguagesForSpeak method only returns the language codes, for example, en for English and fr for French etc. To retrieve the supported language we need to call a web service method " GetLanguagesForSpeakAsync ". Step 7 : First the Panorama item used in development for retrieving the supported speech languages.
Step 6 : Create a UI as per application requirements see the following XAML code snippet. Step 5 : Now add a panorama page to the Windows Phone 7 project.
Please see the following pictures of that. Right-click the Windows Phone Project in the Solution Explorer, and choose Add Service Reference.
Step 4 : To add a web reference of the Microsoft Translator Service, we need to add a service reference to the Windows Phone project.
Step 3 : Create a Windows Phone 7 application project. Step 2 : Enter required information and obtain a valid Bing API AppID.Īfter having registered your application, we will proceed with the Windows Phone 7 application development and invoke the cloud service. Step 1 : Open the following Url to register your application and follow the instructions to obtain a valid Bing API AppID. Here I will show how we can retrieve a list of languages supported by the Microsoft Translator for the Speech API and speak the user's input text.įirst of all we must obtain a valid Bing API AppID, let's use the following steps.
It's pretty simple to archive such kind of functionality in Windows Phone 7 using the Bing API.
In this article I am explaining how to leverage the cloud to solve the problem of Text to Speech translation.