Sunday, November 08, 2009  
Google
Web pcquest.com

CIOL Network sites

Search by Issue | Sitemap | Advanced Search

• For most updated version of DQ TOP 20 issue, visit dqindia.com • Ad : Play and Plug ERP by IBM
 Home > Developer > Voice @ Work

Get from Web. Stream on Intranet

Developed by PCQuest, this is a concept to aggregate content from the Web, convert it to speech and stream it over an intranet

CyberMedia Labs

Friday, April 12, 2002

The first few things you do when you come into office are switch on your PC or laptop, hook into your corporate network, open your mail client and hit Receive. While the mail downloads, you connect your instant messenger and put your Palm in its cradle to hot sync it. Then you probably run your appointment scheduler application and look through the meetings scheduled for the day. Imagine if during this process, you could have the latest news, technological breakthroughs, stock quotes and the weather for the day, read out to you aloud? Not only this, but also the required information updated in audio at frequent intervals throughout the day. Interests you? Read on.

Audio is registered more by your senses than just text on a computer screen. We thought of this concept with the same motive in mind. What if information comes to the user as a background task and in a different medium than text? Here is the methodology—aggregate content from the Web, convert it to audio and stream it on the intranet.

A cursory glance at the kind of software available on the Internet showed that there are indeed many programs that could do some part or the other of the idea we had. In fact, some of the software could also do a combination of the first two steps—aggregate from Web and convert to audio—(though restricted in customizability). So we got the software to interface (communicate) with each other. Though the process may appear crude, the purpose is to demonstrate that it is possible to aggregate, convert and stream content using free tools. 

Get the data
One way to get news from websites is to manually append the latest news headlines to the text file, each day. The second way—our way—is to write some code to download the latest news from news websites. News is hosted in XML format in a file with RDF extension on many popular news sites. These are used by news-ticker applications to connect to them and display the news headlines and other related content as a continuously running ticker. On this month’s CD, we have given a small Java program called NewsParser in the directory /cdrom/Dev Lab/Source/. This connects to the news sites and retrieves the RDF file. Let us set up this program to run and do our job. 

Copy the files NewsParser.java and sites.txt from the directory of this month’s CD to a directory, say java on your hard disk. NewsParser.java file contains the code for the program and sites.txt file contains URLs to RDF files. You can append more URLs in addition to the existing ones. But note that you must append each URL on a separate line. 

To use (compile and execute) the NewsParser program you must install JDK (Java Development Kit) and Java XML pack. First, Install JDK (found in the Dev Labs > SDK/IDE section on this month’s CD). By default JDK will be installed in a directory named j2sdk1.4.0. For Java XML Pack, extract the zipped archive named java_xml_pack-winter01_01-dev.zip of the Java XML pack found in the same CD-ROM, onto your hard disk (say C:\). Now copy the file named xerces.jar (found in the subdirectory jaxp-1.2-ea1 of the extracted archive) to j2sdk1.4.0/lib directory. Change to the directory C:\java, where you copied NewsParser.java and sites.txt earlier and issue the command

C:\j2sdk1.4.0\bin\javac -classpath c:\j2sdk1.4.0\lib\xerces.jar;. NewsParser.java

To execute the NewsParser, use the command

C:\java\java NewsParser > news.txt 

(this would send the output of the parser to a text file called news.txt)You may ask, why the need of our own parser when there are lots of news ticker applications already available that do the job? This was to keep matters simple. We made our parser just a simple piece of code to perform only the intended task. This makes it light and also customizable. We can always add content sources to it at will. 

Here comes sound
This news/data that has been parsed into readable text content, now needs to be converted to audio. Any standard text-to-speech software does this. It reads from text files or from within applications using the Windows Clipboard and gives the output either as WAV/MP3 audio files or just as a sound output from your sound card. 

We used software called Talking Clipboard for our purpose. This uses Microsoft Agent technology and works on any Win 2000/XP machine with the speech components installed on it. The application sits in your system tray with the Merlin character and monitors the clipboard for text. The moment it finds some data there, it reads it out. To interface it with our news parser, we piped the output of the parser to the clipboard. This was made possible by a small command line utility called cb. Just extract the executable into your Windows System directory. The command for the same is | cb. So, instead of sending the output of our parser to a text file, we send it to the clipboard as follows.

C:\java NewsParser | cb

The Talking Clipboard application is started before running the parser. On giving the above command at the prompt, the application is invoked and starts 2 reading the text on the clipboard. Merlin and a balloon showing the contents read, indicate this.

Time to stream
Now you have the audio being read out of your sound card. For streaming this audio, we used Microsoft’s NetShow Encoder (you may use Windows Media Encoder too, or any other live streaming application for that matter). NetShow Encoder gives you the option of capturing audio from your sound card’s line-in or mic-in socket. This is used for broadcasting media content from a live source.

But before you can stream the audio content, you need to channel the output of the sound card to its input. This is a loopback method. For the purpose, you can use a software loopback, which essentially creates a virtual audio cable between the sound card’s output and input. The transfer is digital and hence there is no quality loss. We used software called VAC (Virtual Audio Cable) for this. You can also use an application like Total Recorder. VAC installs as a driver on your PC and does away with a physical interconnection of the concerned In/Out pairs. Make sure that VAC is running before you start up your streaming server. 

Configure NetShow Encoder to capture from Live Source and select the format of encoding and the bandwidth you want to use. The encoder also allows you to store the audio content locally as an ASF file for archival purposes. This file can be hyper-linked to a Web page too.

Checklist
So, finally you have the following software 

  • cb for pipe to Windows Clipboard
  • Talking Clipboard (or any other clipboard reader) for text-to-speech
  • VAC (or Total Recorder) for software loopback on your sound card
  • NetShow Encoder (or any other streaming server software)

The clients connect to the server URL using Windows Media Player. Just run the news parser from a prompt and there you are! For regular updated audio, you can place the parser in a batch file and schedule it to run at specific intervals using the Windows Task Scheduler.

The application of this system is not limited to just getting news from websites. You can use it to broadcast any text as audio. An administrator can select an important piece of information from anywhere (web page or file) and just hit Crtl+C to transmit it as audio on the intranet. With slight ingenuity, it can also serve as a public address system for office-wide announcements, meetings and even entertainment like a regular cricket commentary broadcast! 

Ashish Sharma and  Shekhar Govindarajan 

Next Page :

Software: Been there. Done that

Page(s)   1  2  

Print Comment Email DiggDigg DeliciousDel.icio.us RedittReddit TwitterTwitter


Untitled Document



ZTE:Leading CDMA Technology


Extraordinary Networks:Freedom of Choice


   
 

 
 

Magazine Subscription | RQS | Contact Us | Team PCQuest | Advertising - Print | jobs@cybermedia