Click to See Complete Forum and Search --> : Help with audio (mp3, wav) on my Web page


AtlantaMike
12-18-2005, 11:22 AM
Hello folks,

Have been a reader of the forums for some time now, but this is my first post seeking help.

I am developing a "tribute" page to Stewie Griffin - the angry baby from Family Guy - and want to include the ability for page visitors to play audio files of Stewie's "verbal gems", as I call them.

I know the simple answer would be to upload the mp3 or .wav files, place a link to them and let the visitor's browser handle it from there. In most cases, a "full blown" media player would load or a plug in (such as Quick Time) would load in the browser, thus making it necessary to hit the "back button" to go back to the original page to play other clips.

Instead, I am looking for the capability for the clip to play in a small window and seemingly from the server. I have included a link to a site that comes very close, if not dead on, as to what I want to accomplish. However, that site uses Cold Fusion which my particular hosting package does not allow. Can someone suggest something similar?

Here are the links:

This is my Stewie page (development in progress) with two working links to audio files. To prevent the user from leaving my page, I chose to have the link open in a different window. But this is just not the way I had in mind. Anywho, here's my page, followed by the link to the "ideal" way I would like it to work.

http://www.linkedpublic.com/familyguy.htm

This site plays audio files similar to the way I would like for my site to play them, although I will need a different capability other than ColdFusion:

http://www.audiosparx.com/sa/display/sounds.cfm/sound_group_iid.1842
(click on any of the yellow "play" buttons to see what I mean)

Any help with this would be greatly appreciated !!!

Mike

_Aerospace_Eng_
12-18-2005, 01:35 PM
Maybe this will suit your needs.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
<style type="text/css">
body {
text-align:center;
}
#music {
width:1px;
height:1px;
position:absolute;
top:0;
left:0;
}
</style>
<script type="text/javascript">
function PlayIt(what){
document.getElementById('music').innerHTML='<object width="1" height="1" '
+'classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" '
+'codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" '
+'standby="Loading Microsoft Windows Media Player components..." type="application/x-oleobject">'
+'<param name="url" value="'+what+'">'
+'<param name="uiMode" value="full">'
+'<param name="autoStart" value="true">'
+'<param name="loop" value="true">'
+'<embed type="application/x-mplayer2" '
+'pluginspage="http://microsoft.com/windows/mediaplayer/en/download/" '
+'showcontrols="true" uimode="full" width="1" height="1" '
+'src="'+what+'" autostart="true" loop="true">'
+'</object>';
}
function StopIt(){
document.getElementById('music').innerHTML='';
}
</script>
</head>

<body>
<a href="http://absolutepathtosong.mp3" onclick="PlayIt(this.href);return false">Song 1</a><br>
<a href="#" onclick="StopIt();return false;">Stop</a>
<div id="music">
<object width="1" height="1"
classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6"
codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701"
standby="Loading Microsoft Windows Media Player components..." type="application/x-oleobject">
<param name="url" value="null.mp3">
<param name="uiMode" value="full">
<param name="autoStart" value="true">
<param name="loop" value="true">
<embed type="application/x-mplayer2"
pluginspage="http://microsoft.com/windows/mediaplayer/en/download/"
showcontrols="true" uimode="full" width="1" height="1"
src="null.mp3" autostart="true" loop="true">
</object>
</div>
</html>

welsh
12-18-2005, 01:38 PM
hey, you could use javascript to open a window about the size of the audiosparx one and then you could use flash to play the mp3 or wav file. you could include a play, pause button and etc.

AtlantaMike
12-19-2005, 06:40 PM
Hey, thanks guys. I'm actually meshing both replies into one solution - of sorts - if that makes any sense. I'll keep the forum updated on my progress...