How to use the inline audio recorder

Step 1: assemble the files

Put these files together:

  1. swfobject.js file
  2. audioControl.swf file
  3. your web page

Step 2: Edit the web page

Load the web page in a text editor, and make the following changes:

  1. Insert the swfobject.js file. Put this line in the head of the web page:

    <script type="text/javascript" src="swfobject.js"></script>

  2. Create a div to hold the swf file. Insert this HTML where you want the recorder to appear:

    <div id="flashcontent"></div>

  3. Write the javascript function to load the swf and give it values for the variables. Put this in the head of the web page:

    <script type="text/javascript">
    
    	function loadSWF(sndName){
    		if(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","sound0001);
    			//so.addVariable("soundMode","playOnly");
    			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 loadSWF(sndName){
    		if(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.addVariable("soundMode","playOnly");
    			so.write("flashcontent");		
    		}
    	}
    

    When you call the Javascript function, you pass the sound name as a parameter, like this:

    loadSWF("sound001");

    If you uncomment the following line, then the file will be play-only.

    //so.addVariable("soundMode","playOnly");

  4. Save the file, and load it in your browser.