locked
The type or namespace name 'Speech' does not exist in the namespace 'System' (are you missing an assembly reference?)

    General discussion



  • I've seen the suggested threads like this and this for the solution, but I'm not getting any help from them.

    When I tried installing the Microsoft .NET Framework 4 (Web Installer) after reading this it also gave me an error saying that I can't install the feature as it is already installed. But Still I'm not able to find the .NET tab as mentioned in the thread.

    Here's the Screen Shot to the Add References Window


    Please help me out with this.


    Friday, February 21, 2014 11:44 AM

All replies

  • What framework is your project being built against?

    right click your project, choose properties and then look under 'target framework' Ensure this is 4.0 or greater.

    Friday, February 21, 2014 11:58 AM
  • I could not find anything like 'target framework' in there. Here's the Screen Shot

    And BTW I'm building for Windows 8.1 and using Visual Studio 2013. So I think target framework is higher than 4.0.

    Is there any other way.

    Friday, February 21, 2014 2:19 PM
  • I resolved the issue regarding the Adding Reference to System.Speech by Adding a reference to System.Speech.dll v4.5.1 by browsing right to the dll file.

    But now after building, I'm getting this new error saying

    "Cannot find type System.MarshalByRefObject in module mscorlib.dll"

    Now how do I resolve this issue.

    Friday, February 21, 2014 2:58 PM
  • In newer versions of VS the .NET tab has been replaced by the Assemblies\Framework and Assemblies\Extensions groups.  Same thing though.

    You're building a WinRT app and I don't believe System.Speech.Synthesis works for WinRT.  You should be using Windows.Media.SpeechSynthesis instead.

    Michael Taylor
    http://msmvps.com/blogs/p3net

    Friday, February 21, 2014 3:01 PM
  • In newer versions of VS the .NET tab has been replaced by the Assemblies\Framework and Assemblies\Extensions groups.  Same thing though.

    You're building a WinRT app and I don't believe System.Speech.Synthesis works for WinRT.  You should be using Windows.Media.SpeechSynthesis instead.

    Michael Taylor
    http://msmvps.com/blogs/p3net


    Hello CoolDadTx,

    Thank you for the suggestion.

    But the problem is, if I use Windows.Media.SpeechSynthesis I will have to use a media element in my xaml which I don't want to use.

    On the other hand if I use System.Speech.Synthesis I will just have to call the Speak method.

    Please suggest me a way out.

    I'm using the Grid App Template and I want to Narrate the content of the ItemDetailPage when the user clicks the command button in the Command Bar.

    Friday, February 21, 2014 3:45 PM
  • The error is correct. System.Speech is not available in the .Net Framework for Windows Store apps. Windows.Media.SpeechSynthesis is your only in-box option.

    Why do you object to using a MediaElement? You can wrap this all in a helper function so you don't need to repeatedly set it up and start the narration with just one call.

    --Rob

    Friday, February 21, 2014 3:51 PM
    Owner
  • Actually in all the samples I have referred to, they have used a media element. So that's why. I'm a newbie and can't see how to do what you're suggesting.

    Please help me with the code in implementing it without the use of a media element.

    Friday, February 21, 2014 4:24 PM