.NET Framework - SAPI 5 TTS SpMemoryStream - WAVE Header?

Asked By Richard Nicholas
14-Oct-09 02:15 AM
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/tutorials/aspnet/5eac37f9-f8a4-40bf-a26b-a7cd299b73c9/document-compatibility-in.aspx
Internet Explorer 8
(1)
MemoryStream
(1)
SpWaveFormatEx
(1)
Thread
(1)
Header
(1)
SpMemoryStream
(1)
SpFileStream
(1)
Choice
(1)
  Richard Nicholas replied...
15-Oct-09 06:12 PM
I resolved this by manually creating the RIFF header - see this article for details regarding the header requirements:

http://www.codeproject.com/KB/audio-video/MP3Compressor.aspx?fid=32144&fr=1&df=90&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.




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/tutorials/aspnet/91ebf47b-fd8d-4bc9-a715-40421048a450/a-brief-review-of-generic.aspx
help
Internet Explorer 8 .NET Framework No se si ya lo han probado y si es privativo de un servidor. Me bajé el beta de Internet Explorer 8, lo instalé, con una interfaz muy similar prometiendo mucho, etc. . .etc. Ejecuto una de mis contrario se ejecuta mas rapidamiente las paginas que usan AJAX. Saludos. ASP.NET - Spanish Discussions Internet Explorer 8 (1) ASP.NET (1) Control (1) CasDomGracias (1) VirtualMachine (1) CssAdapters (1) FireFox (1
Internet Explorer 8 y control ocx .NET Framework Mantengo una aplicaci??n desarrollada con .NET 2008, FW 3 nico del lado del cliente. El control funcionaba bien hasta la versi??n 7 de Internet Explorer, sin embargo, algunos de los clientes han optado por actualizar su Internet Explorer a la versi??n 8, empezando a tener inconvenientes con el control. Una cosa que pude observar es que el
internet explorer 8 beta .NET Framework Basicaly MS Int Explorer 8 Beta doesnt work with existing web editors. There are problems like lines go missing. Boxes positions. It was a mistake to upgrade. Can someone tel me how t delete IE 8 and reload IE7 ? Thanks .NET Discussions Int (1) Tel (1) The normal procedure is to uninstall IE8, which should automatically reinstall 7 for you. keywords: internet, explorer, 8, beta description: Basicaly MS Int Explorer 8 Beta doesnt work with existing web editors
Javascript gesperrt .NET Framework Hallo NG, mit dem Internet Explorer 8 habe ich Probleme mit Javascript und den Sicherheitseinstellungen: manchmal funktioniert JavaScript nicht obwohl ActiveScriptung auf Gibt es noch andere Punkte die aktiviert sein müssen? Danke! Frank ASP.NET - German Discussions Internet Explorer 8 (1) ASP.NET (1) Visual (1) ActiveScriptung (1) Sicherheitseinstellungen (1) Internetzone (1) Javascript (1) Aktivieren ASP.NET Zone, die ASP.NET Community keywords: Javascript, gesperrt description: Hallo NG, mit dem Internet Explorer 8 habe ich Probleme mit Javascript und den Sicherheitseinstellungen: manchmal funktioniert JavaScript nicht obwohl A
ANN: MSIE8 BETA 2 .NET Framework Microsoft Windows Internet Explorer 8 BETA 2 [ACHTUNG: inkompat. zu antikem Visual Studio .NET 2002] Blog: Beta 2 Release Notes Scheidegger - 'NETMaster' http: / / dnetmaster.net / C# - German Discussions Visual Studio .NET (1) Windows XP (1) Internet Explorer 8 (1) ANNs (1) Möglichkeiten (1) Neuigkeiten (1) Fachgebiet (1) Neuheiten (1) alle OS + Sprachen inkl Dzaebel [MCP / MVP C#] http: / / Dzaebel.NET keywords: ANN:, MSIE8, BETA, 2 description: Microsoft Windows Internet Explorer 8 BETA 2 [ACHTUNG: inkompat. zu antikem Visual Studio .NET 2002] Blog: URL:blogs.technet