Hear Any RSS Feed

Subscribe to the Technacular RSS feed  RSS Feed or by Email and receive free daily updates

Recently lee in a comment on the article Let The Computer Read PDF Docs For You wondered how nice it would be to have blog postings read out loud (may be mp3 on a CD). I thought may be I should try and work on it. I wrote a rudimentary application to which you can feed any valid RSS feed and it will read the feed to you (yes you will hear sound!)

For this application I used ASP .NET 2.0 along with Microsoft Speech API.

Here is the main snippet of code:

    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);
        }
    }

If you need help running it locally then please contact me info [at] technacular dot com. You will need IIS Server and .NET 2.0 installed.

Download Source Code

Popularity: 5% [?]

Bookmark and Share: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • del.icio.us
  • digg
  • DZone
  • Furl
  • Reddit
  • Spurl
  • Technorati
  • IndianPad
  • StumbleUpon

Related Posts

  • Netvibes Has Problems Dealing With Large Feeds
  • Yahoo Pipes Vs Feedburner Network
  • Make Your RSS Feed Available as a Button on Google Toolbar
  • Personalized content from all over the web
  • 1 comment:

    1. php + text to speech « PHP-BR (Pingback), 11. March 2007, 23:23
       

      […] php + text to speech Hear Any RSS Feed […]

       

    Write a comment:

    Technology Blogs - Blog Top Sites Blog Flux Directory Blogarama - The Blog Directory BuzzBums Technology blogs Technology blogs blog search directory
    Dreamsubmitting Directory Free Link Directory