iveAudio is LiveConnect aware. You use JavaScript to control embedded LiveAudio
elements.
<HTML>
<BODY>
<EMBED SRC="sound1.wav"
HIDDEN=TRUE>
<A HREF="javascript:document.embeds[0].play(false)">
Play the sound now!</A>
</BODY>
</HTML>
<HTML>
<BODY>
<EMBED SRC="sound1.wav"
HIDDEN=TRUE
NAME="firstsound"
MASTERSOUND>
<A HREF="javascript:document.firstsound.play(false)">
Play the sound now!</A>
</BODY>
</HTML>
<HTML>
<HEAD>
<SCRIPT LANGUAGE=JavaScript>
<!-- Hide JavaScript from older browsers
function playDeferredSound() {
document.firstsound.play(false, 'http://url_to_new_sound_file/sound1.wav');
}
// -->
</SCRIPT>
</HEAD>
<BODY>
<EMBED
SRC="stub1.wav"
HIDDEN=TRUE
NAME="firstsound"
MASTERSOUND>
<A HREF="javascript:playDeferredSound()">Load and play the sound</A>
</BODY>
</HTML>
<HTML>
<HEAD>
<SCRIPT LANGUAGE=JavaScript>
<!-- Hide JavaScript from older browsers
function playSound() {
document.firstSound.play(false);
}
function pauseSound() {
document.firstSound.pause();
}
function stopSound() {
document.firstSound.stop();
}
function volup() {
currentVolume = document.firstSound.GetVolume();
newVolume = ( currentVolume + 10 ) ;
if ( document.firstSound.GetVolume() == 100 ) {
alert("Volume is already at maximum");
}
if ( newVolume < 90 ) {
document.firstSound.setvol(newVolume) ;
}
else
{
if ( ( newVolume <= 100 ) && ( newVolume > 90 ) ) {
document.firstSound.setvol(100) ;
}
}
}
function voldown() {
currentVolume = document.firstSound.GetVolume();
newVolume = ( currentVolume - 10 ) ;
if ( document.firstSound.GetVolume() == 0 ) {
alert("Volume is already at minimum");
}
if ( newVolume > 10 ) {
document.firstSound.setvol(newVolume) ;
}
else
{
if ( ( newVolume >= 0 ) && ( newVolume < 10 ) ) {
document.firstSound.setvol(0) ;
}
}
}
// -->
</SCRIPT>
</HEAD>
<BODY>
<EMBED
SRC="sound1.wav"
HIDDEN=TRUE
AUTOSTART=FALSE
NAME="firstSound"
MASTERSOUND>
<P><A HREF="javascript:playSound()">Play the sound now!</A></P>
<P><A HREF="javascript:pauseSound()">Pause the sound now!</A></P>
<P><A HREF="javascript:stopSound()">Stop the sound now!</A></P>
<P><A HREF="javascript:volup()">Increment the Volume!</A></P>
<P><A HREF="javascript:voldown()">Decrement the Volume!</A></P>
</BODY>
</HTML>
file: /Techref/language/JAVA/SCRIPT/liveaud.htm, 9KB, , updated: 2009/2/2 14:27, local time: 2025/5/4 06:26,
3.148.227.92:LOG IN
|
©2025 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions? <A HREF="http://www.piclist.com/tecHREF/language/JAVA/SCRIPT/liveaud.htm"> LiveAudio and LiveConnect </A> |
Did you find what you needed? |
![]() o List host: MIT, Site host massmind.org, Top posters @none found - Page Editors: James Newton, David Cary, and YOU! * Roman Black of Black Robotics donates from sales of Linistep stepper controller kits. * Ashley Roll of Digital Nemesis donates from sales of RCL-1 RS232 to TTL converters. * Monthly Subscribers: Gregg Rew. on-going support is MOST appreciated! * Contributors: Richard Seriani, Sr. |
Ashley Roll has put together a really nice little unit here. Leave off the MAX232 and keep these handy for the few times you need true RS232! |
.