|
All voices works but ScanSoft's. This thing is getting me crazy, please help |
Post Reply |
|
|
09.05.2008 09:59 |
pmonte |
We are developing an asp.net app. We deployed it on Win Server 2003 where we installed a ScanSoft voice (licensed but they do not give great support!!). We have also installed some demo voice from Cepstral.
We have this simple code that save the output to a file.
If we select any voice (Microsoft Sam or the Cepstral ones) it works fine, if we select ScanSoft it procudes a 46 bytes long (short!) wav file. Basically empty. This is the code:
public string SaveToFile(string text, string path, string filename) { SpAudioFormat F = new SpAudioFormat(); F.Type = SpeechAudioFormatType.SAFT11kHz16BitMono; // here we have already tried all possible formats
string file = string.Format("{0}\\{1}.wav", path, filename);
SpVoice m_voice = new SpVoice();
m_voice.Voice = m_voice.GetVoices(string.Format("Name={0}", this.Voice), "Language=410").Item(0); // yes it is an Italian voice, we tried with 409, empty, selecting the voice directly, etc
SpeechStreamFileMode SpFileMode = SpeechStreamFileMode.SSFMCreateForWrite; SpFileStream SpFileStream = new SpFileStream(); SpFileStream.Format = F;
try {
SpFileStream.Open(file, SpFileMode, false);
m_voice.AudioOutputStream = SpFileStream; m_voice.Speak(text, SpeechVoiceSpeakFlags.SVSFlagsAsync); m_voice.WaitUntilDone(Timeout.Infinite);
} finally { SpFileStream.Close(); }
return string.Format("{0}.wav", filename);
}
Any ideas? I have looking into this for 2 weeks now! I would say that it is not a problem related to security rights on the server as I tried to assign admin rights to aspnet, give rights to folders etc.
Please also note that Scansoft voice works perfectly in Control Panel / Speech.
Thanks, thanks a lot! |
 |
|
|
Re: All voices works but ScanSoft's. This thing is getting me crazy, please help |
Post Reply |
|
|
12.05.2008 07:27 |
pmonte |
On 9 Mag, 18:59, pmonte wrote: > We are developing an asp.net app. We deployed it on Win Server 2003 > where we installed a ScanSoft voice (licensed but they do not give > great support!!). We have also installed some demo voice from > Cepstral. > > We have this simple code that save the output to a file. > > If we select any voice (Microsoft Sam or the Cepstral ones) it works > fine, if we select ScanSoft it procudes a 46 bytes long (short!) wav > file. Basically empty. This is the code: > > public string SaveToFile(string text, string path, string filename) > =A0 =A0 =A0 =A0 { > =A0 =A0 =A0 =A0 =A0 =A0 SpAudioFormat F =3D new SpAudioFormat(); > =A0 =A0 =A0 =A0 =A0 =A0 F.Type =3D SpeechAudioFormatType.SAFT11kHz16BitMon= o; // here > we have already tried all possible formats > > =A0 =A0 =A0 =A0 =A0 =A0 string file =3D string.Format("{0}\\{1}.wav", path= , > filename); > > =A0 =A0 =A0 =A0 =A0 =A0 SpVoice m_voice =3D new SpVoice(); > > =A0 =A0 =A0 =A0 =A0 =A0 m_voice.Voice =3D > m_voice.GetVoices(string.Format("Name=3D{0}", this.Voice), > "Language=3D410").Item(0); // yes it is an Italian voice, we tried with > 409, empty, selecting the voice directly, etc > > =A0 =A0 =A0 =A0 =A0 =A0 SpeechStreamFileMode SpFileMode =3D > SpeechStreamFileMode.SSFMCreateForWrite; > =A0 =A0 =A0 =A0 =A0 =A0 SpFileStream SpFileStream =3D new SpFileStream(); > =A0 =A0 =A0 =A0 =A0 =A0 SpFileStream.Format =3D F; > > =A0 =A0 =A0 =A0 =A0 =A0 try > =A0 =A0 =A0 =A0 =A0 =A0 { > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 SpFileStream.Open(file, SpFileMode, false)= ; > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 m_voice.AudioOutputStream =3D SpFileStream= ; > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 m_voice.Speak(text, > SpeechVoiceSpeakFlags.SVSFlagsAsync); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 m_voice.WaitUntilDone(Timeout.Infinite); > > =A0 =A0 =A0 =A0 =A0 =A0 } > =A0 =A0 =A0 =A0 =A0 =A0 finally > =A0 =A0 =A0 =A0 =A0 =A0 { > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 SpFileStream.Close(); > =A0 =A0 =A0 =A0 =A0 =A0 } > > =A0 =A0 =A0 =A0 =A0 =A0 return string.Format("{0}.wav", filename); > > =A0 =A0 =A0 =A0 } > > Any ideas? I have looking into this for 2 weeks now! I would say that > it is not a problem related to security rights on the server as I > tried to assign admin rights to aspnet, give rights to folders etc. > > Please also note that Scansoft voice works perfectly in Control > Panel / Speech. > > Thanks, thanks a lot!
I managed to fix it assigning mssharepointapppool in IIS config, just in case someone else is facing the same prob. |
 |
|