Put these files together:
Load the web page in a text editor, and make the following changes:
<script type="text/javascript" src="swfobject.js"></script>
<div id="flashcontent"></div>
<script type="text/javascript">
var audioConsole;
window.onload = function(){
writeSWF();
if (navigator.appName.indexOf("Microsoft") != -1) {
audioConsole = window["embeddedSWF"];
} else {
audioConsole = document["embeddedSWF"];
}
}
function writeSWF(){
//var so = new SWFObject("hiddenAudioControl.swf", "embeddedSWF", "215", "150", "8", "#FFFFFF");
var so = new SWFObject("hiddenAudioControl.swf", "embeddedSWF", "0", "0", "8", "#FFFFFF");
so.addParam("wmode", "transparent");
so.addVariable("myServer","rtmp://red5.llc.msu.edu/dsh");
so.addVariable("mySound","sound0001");
so.write("flashcontent");
}
</script>
Replace the text in red with the path to your application, and the name of your sound file. You can use scripting to make the name of the sound dynamic, like this:
function writeSWF(sndName){ var so = new SWFObject("audioControl.swf", "audiocontrol", "300", "150", "9", "#FF6600"); so.addParam("wmode", "transparent"); so.addVariable("myServer","rtmp://red5.llc.msu.edu/dsh"); so.addVariable("mySound",sndName); so.write("flashcontent"); }
When you call the Javascript function, you pass the sound name as a parameter, like this:
writeSWF("sound001");
<a href="javascript:audioConsole.recAudio()">RECORD</a> <a href="javascript:audioConsole.stopAudio()">STOP</a> <a href="javascript:audioConsole.playAudio()">PLAY</a>