⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 backsound.txt

📁 背景声音applet小程序
💻 TXT
字号:
BackSound by David C. Ford c. 1999

	The BackSound applet provides ambient sound effects for a web page.Any number of sounds may be used with the BackSound applet. The sounds are played in random order with a random length pause between each sound. A background image or color may be displayed by the applet. BackSound can enhance a website by simulating real life background noise. Just as in real life, BackSound plays sounds in random order at random intervals with varing degrees of frequency.
	This applet is highly customizable. The web page author may set the sounds used, each sounds frequence and the relative length of silence following each sound. BackSound will display, either a specified image or color (but not both).

USAGE: Upload the BackSound.jar file, each of the sound files and optional image file to your web server. Include the following HTML tags in the document that will display the applet.

<applet code="BackSound.class" width="67" height="100">
<param name="numsounds" value="13">
<param name="image" value="speaker.gif">
<param name="color" value="blue">
</applet>

<APPLET ARCHIVE="BackSound.jar" CODE="BackSound.class WIDTH="67" HEIGHT="100">
<PARAM NAME="numsounds" VALUE="13">
<PARAM NAME="image" VALUE="speaker">
<PARAM NAME="color" VALUE="blue">
</APPLET>

You will also need to include three PARAM tags for each sound to be used. These are named soundN, delayN and priorityN where N = a number for the sound. The order that the sounds are numbered is unimportant as they are played in random order. 
<PARAM NAME="sound1" VALUE="cat.au">
<PARAM NAME="delay1" VALUE="4">
<PARAM NAME="priority1" VALUE="3">

PARAMATERS:
numsounds - [required] This is the number of sounds BackSound will use. It must be a positive integer. Note that the number of sounds used will effect the loading time of your web page.

image - [optional] A .gif or .jpg file to display on the page. If the image parameter is used then the color parameter will be ignored if it is used. When used The WIDTH and HEIGHT elements of the APPLET tag need to be set to the dimensions of the image.

color - [optional] The background color to display for the applet. This may be given in one of three formats, rrr.ggg.bbb, rrggbb, or by name.
	rrr.ggg.bbb - this is three integer 0-255 for the red, green and
		blue components.
	rrggbb - the red, green and blue components given in hexidecimal
		format.
	by name - the color may be give by it's java name.
		black, blue, cyan, darkGray, green, lightGray, magenta,
		orange, pink, red, white or yellow.

soundN - [required] The URL of a sound file in .au format. Each sound parameter is numbered 1 through the number of sounds. So if you have 13 sound files (as shown in the APPLET tag above) then you will have 13 sound parameter tags with name elements sound1, sound2, sound3 ... sound13.

delayN - [required] The delay factor for the pause following soundN. The interval following sound in will be a random number of seconds from 1 to 10 multiplied by it's delay factor. Thus if the delay factor for a sound is 4 then sound will be followed by 4, 8, 12, 16, 20, 24, 28 32, 36 or 40 seconds randomly determined. Each sound will have a delay factor numbered 1 through the number of sounds. Thus with 13 sounds the delayN tags will be delay1, delay2, delay3 ... delay13.

priorityN - [required] The priority of each sound determines it's relative frequency. Each soundN will play about priorityN times out of the total of all priority values. If there are 4 sounds and thier priority values are set to 1, 2, 3 and 4 respectively then the 1st sound will play 1 out of 10 times. The 2nd will play 2 out of 10 times, The 3rd - 3 out of 10 and the last 4 out of 10. If all the priorities are the same then all the sounds will play with equal frequency.

CONTROLS - clicking on the applet causes it to toggle between pause and play so viewers may turn the applet "off". A messege is displayed on the browser status line indicating the current status of the applet (paused, pausing, running or rusuming) and the effects of clicking the mouse (click to pause or click to resume).

EXAMPLE:
Here is the HTML for the BackSound applet as used on the demo page included in the .zip file.
<applet code="BackSound.class" width="67" height="100"  archive="BackSound.jar">
<param name="numsounds" value="13">
<param name="sound1" value="cat.au">
<param name="delay1" value="3">
<param name="priority1" value="4">
<param name="sound2" value="Gun-1.au">
<param name="delay2" value="1">
<param name="priority2" value="1">
<param name="sound3" value="cathowl.au">
<param name="delay3" value="3">
<param name="priority3" value="4">
<param name="sound4" value="crickets.au">
<param name="delay4" value="6">
<param name="priority4" value="7">
<param name="sound5" value="dog-1.au">
<param name="delay5" value="6">
<param name="priority5" value="6">
<param name="sound6" value="MachineGun-1.au">
<param name="delay6" value="1">
<param name="priority6" value="1">
<param name="sound7" value="owl.au">
<param name="delay7" value="6">
<param name="priority7" value="3">
<param name="sound8" value="wolf-2.au">
<param name="delay8" value="5">
<param name="priority8" value="5">
<param name="sound9" value="dogs.au">
<param name="delay9" value="3">
<param name="priority9" value="4">
<param name="sound10" value="Porche.au">
<param name="delay10" value="1">
<param name="priority10" value="3">
<param name="sound11" value="siren.au">
<param name="delay11" value="1">
<param name="priority11" value="2">
<param name="sound12" value="Train.au">
<param name="delay12" value="11">
<param name="priority12" value="2">
<param name="sound13" value="Scream.au">
<param name="delay13" value="1">
<param name="priority13" value="1">
<param name="image" value="speaker.gif">
<param name="color" value="blue">
<!--Insert image for non-Java browsers here." -->
</applet>

VERSION HISTORY:
ver 1.0.0 - This version was buggy. Each time the applet was started after pausing a new thread started up playing sounds at random intervals. The rusult was an increasingly frequent playback and eventual system overload. Ver 1.0.0 did not stop when the page was closed.

ver 2.0.0 - Still buggy. The applet would stop when the page was closed but a new threads would still be started with each pause/resume.

ver 2.1.0 - Bugs fixed. BackSound now performs as it should.

FUTURE PLANS:
1) Use the color parameter if the image parameter given can not be loaded.
2) Allow two images, one for play mode and one for pause mode.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -