Abstract:
A method and apparatus that allows a Web page designer to specify that an audio file linked to a Web page should be prefetched before user input is accepted. Web browser software prefetches the audio file if there is enough room in a temporary memory to store the file. The invention also allows a Web page designer to specify the text over which the user must place the cursor to play the audio file. When the temporary memory is full and an audio file needs to be prefetched, the browser deletes files from the temporary memory until there is enough room in the temporary memory for the prefetched audio file. Files are deleted in a least-recently-referenced, first-out order.

Description:
FIELD OF THE INVENTION 
     This application relates to the World Wide Web and, in particular, to a software tool for reducing the time required to play sounds in conjunction with documents on the Web. 
     BACKGROUND OF THE INVENTION 
     The past several years have seen an explosive growth of the internet, and specifically, in the growth of the World Wide Web (hereafter &#34;the Web&#34;). The Web is built around a network of &#34;server&#34; computers which exchange requests and data from each other using the hypertext transfer protocol (&#34;http&#34;). A human designer designs the layout of a Web page and specifies the layout of the page using HTML (&#34;Hypertext Markup Language&#34;). Several versions of HTML are currently in existence. Examples include HTML versions 2.0 and 3.0, as specified by the WWW Consortium of MIT. 
     A user views a Web page using one of a number of commercially available &#34;browser&#34; programs. The browser submits an appropriate http request to establish a communications link with a Web server of the network. A typical http request references a Web page by its unique Uniform Resource Locator (&#34;URL&#34;). A URL identifies the Web server hosting that Web page, so that an http request for access to the Web page can be routed to the appropriate Web server for handling. Web pages can also be linked graphically to each other. 
     Ever since the Mosaic browser, which was developed by the University of Illinois, it has been possible to have a sound effect as the destination for a hypertext link on the Web. When the user clicks on the area associated with the sound, the browser retrieves an audio file from the remote server and plays it. Early browsers actually played audio files by passing them to so-called &#34;helper applications,&#34; but current browsers have audio players built in. Unfortunately, this standard approach (retrieving the audio file at a user&#39;s request) is ill-suited for small sound effects (e.g., a bird call or a name pronunciation) because of network latency. The user does not get to hear the sound until several seconds after he or she has clicked on the link. Experimentation has shown that a user needs to get the result of traversing a hypertext link within a single second for the user to feel that he or she is navigating freely. 
     A second approach supports so-called &#34;background sounds&#34; that will play automatically as soon as the browser has finished downloading a page. The problem with this approach is that the sound will be played under all circumstances, and thus not under user control when the user desires to hear a specific sound. Also, no more than a single sound can be associated with the page. 
     SUMMARY OF THE INVENTION 
     The present invention overcomes the problems and disadvantages of the prior art by adding an extension to HTML that specifies that certain audio files should be prefetched before user input is accepted for a displayed Web page. The invention also enables the designer to specify that only certain audio files should be prefetched. For example, it is not always desirable to prefetch a very large audio file because it would take too much time. The HTML format allows a Web page designer to specify the information over which the user must place the cursor to activate the prefetched audio output. The invention also includes browser software that can prefetch audio files in accordance with instructions in the HTML. 
     In accordance with the purpose of the invention, as embodied and broadly described herein the invention is a method of processing HTML that describes a Web page, comprising the steps performed by a data processing system, of receiving HTML describing the Web page; reviewing the HTML to locate a SOUND attribute in the HTML, the SOUND attribute being associated with an audio file; prefetching the audio file; and storing the prefetched audio file in a memory of the data processing system. 
     In further accordance with the purpose of this invention, as embodied and broadly described herein the invention is a computer system that processes HTML describing a Web page, the computer system having a memory, comprising: an HTML receiving portion that receives the HTML describing the Web page; a reviewing portion that reviews the HTML to locate a SOUND attribute in the HTML, the SOUND attribute being associated with an audio file; a prefetch portion that prefetches the audio file; and a storage portion that stores the prefetched audio file in the memory of the computer system. 
     Objects and advantages of the invention will be set forth in part in the description which follows and in part will be obvious from the description or may be learned by practice of the invention. The objects and advantages of the invention will be realized and attained by means of the elements and combinations particularly pointed out in the appended claims. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate several embodiments of the invention and, together with the description, serve to explain the principles of the invention. 
     FIG. 1 is a block diagram of a computer system in accordance with a preferred embodiment of the present invention. 
     FIG. 2 shows a format of a HyperText Markup Language (HTML) element in accordance with the embodiment of FIG. 1. 
     FIG. 3 is a flow chart showing steps performed by browser software prior to displaying a Web page. 
     FIG. 4 is a flow chart showing steps performed by the browser software to display a Web page. 
     FIG. 5(a) shows an example of contents of a temporary memory of FIG. 1. 
     FIG. 5(b) shows an example of contents of a temporary memory of FIG. 1. 
     FIG. 5(c) shows an example of a data structure stored in a memory of FIG. 1. 
    
    
     DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENT 
     Reference will now be made in detail to a preferred embodiment of the invention, an example of which is illustrated in the accompanying drawings. Wherever possible, the same reference numbers will be used throughout the drawings to refer to the same or like parts. 
     FIG. 1 is a block diagram of a computer system 100 in accordance with a preferred embodiment of the present invention. Computer system 100 includes a first computer 110 and a second computer 120. First computer 110 and second computer 120 are connected together via line 106, which can be, for example, a LAN, a WAN, or an internet connection. Line 106 can also represent a wireless connection, such as a cellular network connection. 
     First computer 110 includes a CPU 102; a memory 104; input/output lines 105; an input device 150, such as a keyboard or mouse; and a display device 160, such as a display terminal. First computer 110 also includes an input device 161 that reads computer instructions stored on computer readable medium 162. These instructions are the instructions of e.g., browser software 130. Memory 104 of first computer 110 includes browser software 130, Hypertext Markup Language (HTML) 135, and a database or data structure (DB) 170. A portion of memory 104 is designated as temporary memory 180. A person of ordinary skill in the art will understand that memory 104 also contains additional information, such as application programs, operating systems, data, etc., which are not shown in FIG. 1 for the sake of clarity. 
     Second computer 120 includes a CPU 102&#39; and a memory 104&#39;. Memory 104&#39; of second computer 120 includes server software 140, Hypertext Markup Language (HTML) 145, and an audio file 147. HTML 135 in the memory of first computer 110 was downloaded over line 106 from HTML 145 of second computer 120. A person of ordinary skill in the art will understand that memory 104&#39; also contains additional information, such as application programs, operating systems, data, etc., which are not shown in FIG. 1 for the sake of clarity. Server 140, HTML 145, and audio file 147 can also be located in memory 104 of first computer 110. 
     It will be understood by a person of ordinary skill in the art that computer system 100 can also include numerous elements not shown in the FIG. 1 for the sake of clarity, such as disk drives, keyboards, display devices, network connections, additional memory, additional CPUs, LANs, input/output lines, etc. A preferred embodiment of the invention runs under the Solaris operating system, Version 2.5. Solaris is a registered trademark of Sun Microsystems, Inc. 
     The present invention speeds up the process of playing sound in conjunction with Web pages. In the present invention, some audio files are specified in the HTML for a Web page with a attribute indicating that they should be prefetched if possible. When a Web page is first displayed, the browser prefetches as many of these audio files as will fit in temporary memory. Thus, when the user activates an audio file (usually by clicking on text or graphics linked to the audio file), the prefetched audio file can be played immediately without waiting for the time normally required to download the audio file over line 106. In a preferred embodiment, Web pages specified using the present invention can still be displayed using Web browsers that have not been enhanced to recognize HTML SOUND attributes because these browsers will simply ignore the SOUND attribute. 
     FIG. 2 shows an example of a format of an anchor element in accordance with a preferred embodiment of the present invention. The format of conventional HTML is described in, for example, Morris, &#34;HTML for Fun and Profit,&#34; SunSoft Press 1995, which is herein incorporated by reference. The format includes a first text string 210 surrounded by brackets (&#34;&lt;&#34; and &#34;&gt;&#34;). The characters &#34;A HREF=&#34; are followed by a URL 211 of an audio file (e.g., toot.au). The audio file can be of any appropriate format, such as. AU or .WAV formats. The attribute &#34;SOUND&#34; 212 indicates that the audio file should be prefetched. 
     Next, a second text string 214 (e.g., playme) identifies information that is displayed on the Web page and that should be linked to the audio file. The string 214 can identify any information that has a visual appearance on display device 160, including images, literal character strings animations (given a system of sufficient response time) and JAVA applets. JAVA is a registered trademark of Sun Microsystems, Inc. Thus, for example, audio output can be associated with an icon if the displayed information identifies a file containing the graphical information of an icon. Next, a third text string 216 consists of the string &#34;&lt;/A&gt;&#34; to indicate the end of the SOUND element. 
     FIG. 3 is a flow chart showing steps performed by browser software 130 prior to displaying a Web page. It will be understood by persons of ordinary skill in the art that the steps of flow charts in this document are performed by CPU 102 of FIG. 1 executing the instructions of browser 130 in accordance with HTML 135. Initially, in step 302, a COUNT variable in memory 104 is set to &#34;0.&#34; COUNT is incremented each time a new page is viewed via the browser and, therefore, keeps track of a current page number that is currently being viewed. A page having a lowest associated COUNT value was viewed the longest ago in time. Step 304 represents the top of a loop performed for each Web page viewed. In step 305, the COUNT variable is incremented so that its value represents the new page to be viewed. In step 306, the browser requests HTML 145 for a current page from server 140. In step 308, server 140 sends the requested HTML to the browser where it is stored as HTML 135 in memory 104. In step 310, the browser determines whether HTML 135 contains any anchor link elements with SOUND attributes. If so, certain initialization steps 312-322 are performed. 
     Step 312 is the top of a loop performed for each anchor link element in HTML 135 that has the format shown in FIG. 2. If, in step 314, the audio file specified in the anchor link element has not been prefetched, then, in step 316, information about the audio file is stored in a data structure (such as a database or table). (If the audio file has already been prefetched, its URL is already present in the data structure, as discussed below). The stored information includes an identification of the region of the screen where the &#34;playme&#34; information 214 is located, the URL of the audio file, and the current COUNT value. 
     If the audio file has been prefetched then, in step 318, the old COUNT value for the audio file in the database is replaced by the current COUNT value to indicate that the audio file is referenced on the current page. Steps 320 and 322 represent the loop ends. 
     FIG. 4 is a flow chart showing steps performed by browser 130 to display a Web page. In step 402, the page is displayed on display device 160 in accordance with HTML 135, in a manner known to persons of ordinary skill in the art. It will be understood that there are other steps (not shown) that are performed by browser 130 to display a Web page and to accept input from the user. Many of these steps are not described herein to enhance the clarity of the example. 
     In step 404, if there are SOUND attributes present in HTML 135, steps 406-418 are performed. Step 406 is the top of a loop performed for each audio file URL in the data structure that has the current value of COUNT (i.e., for each audio file of the current page that was specified with a SOUND attribute). Step 408 fetches the audio file 147 specified by its URL in the data structure. 
     Memory 104 of FIG. 1 includes a temporary memory 180 of a predetermined size, such as one megabyte. In step 410, if the fetched audio file will fit in an unused portion of temporary memory 180, it is stored therein in step 412 and a pointer to its location in temporary memory is placed in the data structure. If the audio file will not fit in temporary memory, steps 410-416 remove audio files of pages viewed the longest time ago from temporary memory until the fetched audio file will fit. If, in step 414, only audio files for the current page remain in temporary memory and there still is not room, the fetched audio file is discarded in step 415 and control passes to step 418. Step 418 represents a loop end. 
     Steps 420-430 represent a loop performed to receive user input (such as mouse clicks) and to respond thereto. In step 422, if the user clicks on an area link associated with an audio file, then steps 424-428 are performed. In step 424, if the audio file was specified in HTML 135 with a SOUND attribute and if the audio file actually was prefetched and stored in step 412 then, in step 428, the audio is retrieved from the temporary memory and played. Because retrieval from temporary memory does not involve an access over line 106, it occurs very fast and there is a very short period of time between the user&#39;s click and the sound. In contrast, if the audio file was not specified in the HTML as prefetchable, or if there was no room in temporary memory to prefetch the audio file, the audio file 147 is fetched over line 106 in step 426 and played. Step 426 may involve for example, an internet access and as a general rule takes longer than step 428. 
     FIGS. 5(a) through 5(c) provide an example of prefetching audio files. As shown in the &#34;HTML&#34; column, audio files to be prefetched are specified using a SOUND attribute 500. The &#34;Page Display&#34; column indicates that the text graphic associated with each audio file is displayed on the Web page. In FIG. 5(a), the user has viewed two pages. A first page 502 has two instances of a link to an audio file Sound1.au. A second page 504 has a link to an audio file Sound2.au and a link to an audio file Sound3.au. In FIG. 5(a) a database 506 stores region, URL, COUNT value, and a temporary memory location for each audio file. The audio files have been prefetched and stored in temporary memory 508? 
     In FIG. 5(b), a new page 515 is viewed. The new page also has a link to audio file Sound1.au. Audio file Sound1.au was previously prefetched when page 502 of FIG. 5(a) was displayed. Thus, in accordance with step 318 of FIG. 3, the COUNT value 520 in database 506 for audio file Sound1.au is changed to the current COUNT value of &#34;3&#34; to indicate that the audio file was most recently referenced on third page 515. 
     In FIG. 5(c), a new page 525 is viewed. The new page has a link to an audio file Sound4.au. In the example, after Sound4.au was fetched over line 106, it was apparent that there was insufficient room in temporary memory 508 for the file. Thus, Sound2.au was removed from temporary memory 508 because it was the first file having a lowest COUNT value (&#34;2&#34;) (See FIG. 5(b)). In the example, once Sound2.au was removed, there was room in temporary memory for Sound4.au and that file was stored in temporary memory 506 in accordance with step 412 of FIG. 4. Thus, in FIG. 5(c), audio files Sound1.au, Sound 3.au, and Sound 4.au have been prefetched and can be played immediately when the user selects their displayed links. 
     Prefetching is preferably performed using some scheme that allows many computer activities to progress in parallel. A preferred embodiment uses the multi-threading capability of Solaris 2.5 is the preferred means, but others can be used too. Thus, if the user issues any commands (e.g., to go to another page) before the download/prefetch is completed, then the computer will accept this input and perform the requested action. 
     Any audio file downloads in progress when the user issues a command to go to a new page will be treated as follows: 
     a) If the user uses a &#34;open in new window&#34; command (that is, the new page will open in a different window from that used to display the current page), then the sound downloads are temporarily suspended while the new page is downloaded and then resumed as soon as its HTML text has been downloaded. 
     b) If the user uses a &#34;open in same window&#34; command (that is, the new page will replace the current page and be displayed in the same window), then all sound downloads in progress are immediately terminated. 
     In summary, the present invention allows the designer of a web page to specify whether to prefetch audio files that are to be played when the user selects an associated text or graphic. If no SOUND attribute is present in the HTML, the audio file is not prefetched. It is desirable that the designer can specify which audio files to prefetch, since some audio files are very large. Such files would take too much space in the temporary memory. 
     Other embodiments will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. It is intended that the specification and examples be considered as exemplary only, with a true scope of the invention being indicated by the following claims and equivalents.