Click here to Skip to main content
15,867,835 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
hi i am developing a Windows phone application. where i need to convert speech to text .. i am using the following code .. but a debugg error is facing me .. plz tell me where i am wrong or else do i have any other method .
added
ID_CAP MICROPHONE
ID_CAP_SPEECH_REGOGNITION

added
C#
using Windows.Phone.Speech.Recognition;
using Windows.Foundation

C#
namespace txtspeech
{
    public partial class MainPage : PhoneApplicationPage
    {
        // Constructor
        public MainPage()
        {
            InitializeComponent();
            this.syn = new SpeechSynthesizer();
        }
        private IAsyncAction task;
        SpeechSynthesizer syn = new SpeechSynthesizer();
        private void Read_Click(object sender, RoutedEventArgs e)
        {
           syn.CancelAll();
           task = syn.SpeakTextAsync("hello");
        }
    }
}


also written

C#
namespace samplespeech
{
    public partial class MainPage : PhoneApplicationPage
    {
        // Constructor
        public MainPage()
        {
            InitializeComponent();
        }
        SpeechSynthesizer synth;
        private async void Button_Click(object sender, RoutedEventArgs e)
        {   synth = new SpeechSynthesizer();
            await synth.SpeakTextAsync("input TextBox");
        }
    }
}

In Both the cases i am getting a debugg error .. the error is at SpeakTextAsync just after 2-3 seconds after button click
Posted
Updated 5-May-15 2:47am
v4
Comments
CHill60 5-May-15 8:48am    
And the error is ....?
Aditya_Goud 7-May-15 0:53am    
+ ExceptionObject {System.IO.DirectoryNotFoundException: The system cannot find the path specified.

The system cannot find the path specified.

at Windows.Phone.Speech.Synthesis.SpeechSynthesizer.SpeakTextAsync(String content)
at samplespeech.MainPage.<read_click>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.<ThrowAsync>b__3(Object state)} System.Exception {System.IO.DirectoryNotFoundException}
Aditya_Goud 7-May-15 0:54am    
its a debugg error.. CHill60 .. the exception looks like this
Style-7 5-May-15 9:01am    
http://stackoverflow.com/questions/21139461/speechsynthesizer-speaktextasync-throws-unauthorizedaccessexception-in-periodics

here is the perfect link !
the solution is to enable speech recognition in mobile too !

http://www.bjarneryd.se/?p=115[^]
 
Share this answer
 
Hi
Could plz share your getting error message so that i can help to your queries
 
Share this answer
 
Comments
Aditya_Goud 7-May-15 0:53am    
+ ExceptionObject {System.IO.DirectoryNotFoundException: The system cannot find the path specified.

The system cannot find the path specified.

at Windows.Phone.Speech.Synthesis.SpeechSynthesizer.SpeakTextAsync(String content)
at samplespeech.MainPage.<read_click>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.<ThrowAsync>b__3(Object state)} System.Exception {System.IO.DirectoryNotFoundException}
CHill60 7-May-15 4:07am    
If you have a question or comment for the OP then use the "Have a Question or Comment?" link next to the post. Do not post comments as a "Solution" - it removes the post from the list of unanswered questions and restricts the number of members who will look at it. Please delete this solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900