Using ASP.NET 2.0 along with Microsoft Speech API.

I’ve done a lot of feed reading and writing over my more recent professional career, and something that has always been a fascination of mine, has always been an engine which could “read” RSS/ATOM feeds.  That is, an engine which can turn a feed, into a set of MP3’s.

I had bookmarked this page a while ago, and found it when cleaning up my bookmarks.  I didn’t want it bookmarked anymore so I thought I would blog it and share the link with the other 2 people subscribed to this blog.

The library itself is not too shabby, but the Microsoft Speech Engine is actually pretty lame.  I guess there is always time though.

The code looks like:

private void SoundFeed(string url, int itemCount)
{
try
{
RssFeed feed = RssFeed.Read(url);
RssChannel channel = (RssChannel)feed.Channels[0];

if (channel.Items.Count > 0)
{
SpVoice readr = new SpVoice();
readr.Speak(“Your are listening to “ +
channel.Title + “.”,
SpeechVoiceSpeakFlags.SVSFDefault);

int counter = 1; // num of items tracker
foreach (RssItem item in channel.Items)
{
if (counter > itemCount)
break;
if (!item.Title.Trim().Equals(string.Empty))
{
readr.Speak(“Reading Item “ +
counter.ToString() + “.”,
SpeechVoiceSpeakFlags.SVSFDefault);
readr.Speak(“Title of the Post: “,
SpeechVoiceSpeakFlags.SVSFDefault);
readr.Speak(item.Title.Trim(),
SpeechVoiceSpeakFlags.SVSFDefault);
readr.Pause();
}

if (!item.Description.Trim().Equals(string.Empty))
{
readr.Resume();
readr.Speak(item.Description.Trim(),
SpeechVoiceSpeakFlags.SVSFDefault);
}

counter++;
}
}

}
catch (Exception ex)
{
throw (ex);
}
}

I think I shall have to play with this some more soon and make me a Windows Mobile 6.0 app to download podcasts for me to listen to each night.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.