SAPI 5 TTS SpMemoryStream - WAVE Header?

R

Richard Nicholas

The SAPI SDK is quite useful in providing simple TTS examples to create a WAV file (Using SpFileStream automation object) however I need to convert text to an MP3 file.

I can successfully convert the resulting WAV file created from the SpFileStream to MP3 however I want to skip the step of writing a wav file simply to convert it to mp3.

To avoid the step of creating the file I can create the audio to a memorystream from the text using SAPI's SpFileStream object however this does not create the WAVE/RIFF header required by the compression process.

Peter Bromberg's articles on TTS using SAPI & MemoryStream all confirm that no WAV header is provided with the raw audio so am I really stuck with this in-between process of writing to the filestream in order to access the header?? Seems silly... Anybody?? Peter??

thx in advance

EggHeadCafe - Software Developer Portal of Choice
Document Compatibility in Internet Explorer 8
http://www.eggheadcafe.com/tutorial...b-a7cd299b73c9/document-compatibility-in.aspx
 
R

Richard Nicholas

I resolved this by manually creating the RIFF header - see this article for details regarding the header requirements:

http://www.codeproject.com/KB/audio...mpp=25&noise=3&sort=Position&view=Quick#xx0xx

I collected the various values required for the header from the SpWaveFormatEx object - see SAPI5 SDK.



Richard Nicholas wrote:

SAPI 5 TTS SpMemoryStream - WAVE Header?
14-Oct-09

The SAPI SDK is quite useful in providing simple TTS examples to create a WAV file (Using SpFileStream automation object) however I need to convert text to an MP3 file.

I can successfully convert the resulting WAV file created from the SpFileStream to MP3 however I want to skip the step of writing a wav file simply to convert it to mp3.

To avoid the step of creating the file I can create the audio to a memorystream from the text using SAPI's SpFileStream object however this does not create the WAVE/RIFF header required by the compression process.

Peter Bromberg's articles on TTS using SAPI & MemoryStream all confirm that no WAV header is provided with the raw audio so am I really stuck with this in-between process of writing to the filestream in order to access the header?? Seems silly... Anybody?? Peter??

thx in advance

Previous Posts In This Thread:

EggHeadCafe - Software Developer Portal of Choice
A Brief Review of Generic Collection Classes
http://www.eggheadcafe.com/tutorial...5-40421048a450/a-brief-review-of-generic.aspx
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top