c# - AccessViolationException in Windows.Media.SpeechSynthesis.SpeechSynthesizer constructor -


my app getting accessviolationexception when calling default constructor of windows.media.speechsynthesis.speechsynthesizer class. happens on 1 particular machine (so far @ least), surface pro 3 running windows 8.1. other machines app installed not experience issue.

my code this:

class speech {     private windows.media.speechsynthesis.speechsynthesizer _synthesizer;     public speech()     {         setvoice();     }      private void setvoice()     {         try         {             // exception raised here             _synthesizer = new windows.media.speechsynthesis.speechsynthesizer();         }         catch (exception e)         {          }     } } 

the stack trace shows in event logs looks this:

description: process terminated due unhandled exception exception info: system.accessviolationexception stack:     @ windows.media.speechsynthesis.speechsynthesizer..ctor()     @ ... speech.setvoice()     @ ... speech..ctor() 

i captured dump file using procdump , can see in stacktrace (it doesn't show "my code" code after it):

sapi.dll!cspobjecttokenenumbuilder::checktokensignature(struct ispdatakey *) unknown sapi.dll!cspobjecttokenenumbuilder::addtokensfromdatakey(struct ispdatakey *,unsigned short const *,unsigned short const *) unknown sapi.dll!cspobjecttokencategory::internalenumtokens(unsigned short const *,unsigned short const *,struct ienumspobjecttokens * *,int) unknown sapi.dll!cspobjecttokencategory::enumtokens(unsigned short const *,unsigned short const *,struct ienumspobjecttokens * *) unknown windows.media.speechsynthesis.dll!spenumtokens(unsigned short const *,unsigned short const *,unsigned short const *,struct ienumspobjecttokens * *) unknown windows.media.speechsynthesis.dll!windows::media::speechsynthesis::installedvoicesstatic::get_allvoices(struct windows::foundation::collections::ivectorview<class windows::media::speechsynthesis::voiceinformation *> * *) unknown windows.media.speechsynthesis.dll!windows::media::speechsynthesis::installedvoicesstatic::get_defaultvoicewithrank(struct windows::media::speechsynthesis::ivoiceinformation * *,unsigned int *) unknown windows.media.speechsynthesis.dll!windows::media::speechsynthesis::cspeechsynthesizer::getdefaultvoice(struct windows::media::speechsynthesis::ivoiceinformation * *,unsigned int *) unknown windows.media.speechsynthesis.dll!windows::media::speechsynthesis::cspeechsynthesizer::createsynthesizerobject(void) unknown windows.media.speechsynthesis.dll!windows::media::speechsynthesis::cspeechsynthesizer::runtimeclassinitialize(void) unknown windows.media.speechsynthesis.dll!microsoft::wrl::details::makeandinitialize<class windows::media::speechsynthesis::cspeechsynthesizer,class windows::media::speechsynthesis::cspeechsynthesizer>(class windows::media::speechsynthesis::cspeechsynthesizer * *) unknown windows.media.speechsynthesis.dll!windows::media::speechsynthesis::installedvoicesstatic::activateinstance(struct iinspectable * *) unknown 

its weird error seems escaping try/catch block. on 1 customer's machine

any ideas happening?

i believe customer has bad data in registry key hkey_local_machine\software\microsoft\speech\voices\tokens, sapi stores information voices installed on system.

clearly, keys present (given code trying add token registry key), values corrupt, causing av in native code.

other areas check (if applicable system) be:

  • hkey_current_user\software\microsoft\speech\voices\tokens
  • hkey_local_machine\wow6432node\software\microsoft\speech\voices\tokens
  • hkey_current_user\wow6432node\software\microsoft\speech\voices\tokens

Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -