Hi,
I am trying to use the SpeechLib.dll to convert text to speech and
save it into a .wav file using ASP.NET on an Windows 2000 IIS
webserver.
Here is the code:
---------------------------------------------------
SpeechLib.SpFileStream spfilestream;
string filename= "C:\\Anil\\WavTemp2.wav";
spfilestream = new SpFileStreamClass();
spfilestream.Open(filename,SpeechStreamFileMode.SS FMCreateForWrite,false);
SpeechLib.ISpeechVoice ispvoice1= new SpVoiceClass();
ispvoice1.AudioOutputStream = spfilestream;
ispvoice1.Speak("This the text that is being
recorded.",SpeechVoiceSpeakFlags.SVSFDefault);
spfilestream.Close();
-------------------------------------------------------
When I run the code the first time, it creates the .wav file in the
directory but doesnt write anything to it and it gives me an error:
---------------------------------------------------------------------
Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
information about the error and where it originated in the code.
Exception Details: System.UnauthorizedAccessException: Access is
denied.
The ASP.NET process is not authorized to access the requested
resource. For security reasons the default ASP.NET process identity is
'{machinename}\ASPNET', which has limited privileges. Consider
granting access rights to the resource to the ASP.NET process
identity.
To grant ASP.NET write access to a file, right-click the file in
Explorer, choose "Properties" and select the Security tab. Click "Add"
to add the "{machinename}\ASPNET" user. Highlight the ASP.NET account,
and check the Write box in the Allow column.
Source Error:
Line 53: ispvoice1.AudioOutputStream =spfilestream;
Line 54:
Line 55: ispvoice1.Speak("This the text that is being
recorded.",SpeechVoiceSpeakFlags.SVSFDefault);
Line 56:
Line 57: spfilestream.Close();
----------------------------------------------------------------------
I have given the aspnet user access to the .aspx files im using and
SpeechLIb.dll, and the directory that stores the .wav file
When I run the code again while the .wav file exists it throws another
error:
-------------------------------------------------------------------------
Exception from HRESULT: 0x80030002 (STG_E_FILENOTFOUND).
Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
information about the error and where it originated in the code.
Exception Details: System.Runtime.InteropServices.COMException:
Exception from HRESULT: 0x80030002 (STG_E_FILENOTFOUND).
Source Error:
Line 47: spfilestream = new SpFileStreamClass();
Line 48:
Line 49: spfilestream.Open(filename,SpeechStreamFileMode.SS FMCreateForWrite,false);
Line 50:
Line 51: SpeechLib.ISpeechVoice ispvoice1= new SpVoiceClass();
----------------------------------------------------------------------------
Has anyone done something like this before or understand what the
problem is?
Thanks in Advance
AD 1 5478
Just a guess, but it seems that the IIS_USER account doesn't have
rights to c:\anil. Try making that folder a virtual folder with write
access.
Like I said, just a guess.
On 22 Aug 2003 10:27:30 -0700, an*******@hotmail.com (Anil) wrote: Hi,
I am trying to use the SpeechLib.dll to convert text to speech and save it into a .wav file using ASP.NET on an Windows 2000 IIS webserver.
Here is the code:
---------------------------------------------------
SpeechLib.SpFileStream spfilestream;
string filename= "C:\\Anil\\WavTemp2.wav";
spfilestream = new SpFileStreamClass();
spfilestream.Open(filename,SpeechStreamFileMode.S SFMCreateForWrite,false);
SpeechLib.ISpeechVoice ispvoice1= new SpVoiceClass();
ispvoice1.AudioOutputStream = spfilestream;
ispvoice1.Speak("This the text that is being recorded.",SpeechVoiceSpeakFlags.SVSFDefault);
spfilestream.Close(); -------------------------------------------------------
When I run the code the first time, it creates the .wav file in the directory but doesnt write anything to it and it gives me an error:
--------------------------------------------------------------------- Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.UnauthorizedAccessException: Access is denied.
The ASP.NET process is not authorized to access the requested resource. For security reasons the default ASP.NET process identity is '{machinename}\ASPNET', which has limited privileges. Consider granting access rights to the resource to the ASP.NET process identity.
To grant ASP.NET write access to a file, right-click the file in Explorer, choose "Properties" and select the Security tab. Click "Add" to add the "{machinename}\ASPNET" user. Highlight the ASP.NET account, and check the Write box in the Allow column.
Source Error:
Line 53: ispvoice1.AudioOutputStream =spfilestream; Line 54: Line 55: ispvoice1.Speak("This the text that is being recorded.",SpeechVoiceSpeakFlags.SVSFDefault); Line 56: Line 57: spfilestream.Close();
----------------------------------------------------------------------
I have given the aspnet user access to the .aspx files im using and SpeechLIb.dll, and the directory that stores the .wav file
When I run the code again while the .wav file exists it throws another error:
------------------------------------------------------------------------- Exception from HRESULT: 0x80030002 (STG_E_FILENOTFOUND). Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Runtime.InteropServices.COMException: Exception from HRESULT: 0x80030002 (STG_E_FILENOTFOUND).
Source Error:
Line 47: spfilestream = new SpFileStreamClass(); Line 48: Line 49: spfilestream.Open(filename,SpeechStreamFileMode.SS FMCreateForWrite,false); Line 50: Line 51: SpeechLib.ISpeechVoice ispvoice1= new SpVoiceClass();
----------------------------------------------------------------------------
Has anyone done something like this before or understand what the problem is?
Thanks in Advance AD This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: rawCoder |
last post by:
Hi All,
I have a *.cer file, a public key of some one and I want to encrypt some
thing using this public key.
Can someone point me to a sample code for Encrypting some file using...
|
by: Mike |
last post by:
When trying to compile (using Visual Web Developer 2005 Express Beta;
frameworkv2.0.50215 ) the source code below I get errors (listed below due to
the use of ICallBackEventHandler. Ultimately I...
|
by: Christopher Benson-Manica |
last post by:
Why can't I use a class destructor in a using declaration:
using MyClass::~MyClass;
?
--
Christopher Benson-Manica | I *should* know what I'm talking about - if I
ataru(at)cyberspace.org ...
|
by: beliavsky |
last post by:
Many of my C++ programs have the line
using namespace std;
but the "Accelerated C++" book of Koenig and Moo has many examples
where the library names are included one at a time, for example
...
|
by: Petter Reinholdtsen |
last post by:
I ran into a problem on HP-UX 11.00 the other day, where it refused to
compile a program using 'using namespace std;' at the top. The reason
seem to be that the compiler refuses to accept 'using...
|
by: john.burton.email |
last post by:
I've done some extensive searching and can't seem to find an answer to
this -
Is it correct to using "using" with templates, for example:
using std::vector;
Or do I need to specify the type...
|
by: Enos Meroka |
last post by:
Hallo,
I am a student doing my project in the university.. I have been trying
to compile the program using HP -UX aCC compiler, however I keep on
getting the following errors.
...
|
by: Calum Grant |
last post by:
In older C++ computer books, you'll often see
using namespace std;
even in my 1996 copy of Stroustrup. Nowadays, it seems to be considered
better to qualify names to make it clearer what...
|
by: JDeats |
last post by:
I have some .NET 1.1 code that utilizes this technique for encrypting
and decrypting a file.
http://support.microsoft.com/kb/307010
In .NET 2.0 this approach is not fully supported (a .NET 2.0...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
| |