if(widgetStylesPrinted != true) {document.write('');}var widgetStylesPrinted = true;var content = '
<?xml version="1.0" encoding="utf-8"?> <mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" width="162" height="274"> <mx:Script> <![CDATA[ [Embed(source="../pbj/Volume1Channel.pbj", mimeType="application/octet-stream")] private function loadAudioFile():void { var fileToLoad:File = new File(); } { var fileToLoad:File = event.target as File; source.load(urlRequest); } { output.addEventListener(SampleDataEvent.SAMPLE_DATA, processSound); output.play(); } private function processSound(event:SampleDataEvent):void { shaderBuffer.length = BUFFER_SIZE * 2 * 4; sourcePos += source.extract(shaderBuffer, BUFFER_SIZE, sourcePos); shaderBuffer.position=0; effectShader.data["source"].width = BUFFER_SIZE / 1024; effectShader.data["source"].height = 512; effectShader.data["source"].input = shaderBuffer; effectShader.data["volume"].value = [ leftSlider.value, righttSlider.value ]; var effectJob:ShaderJob = new ShaderJob( effectShader, event.data, BUFFER_SIZE / 1024, 512 ); effectJob.start(true); if ( ( sourcePos >= (source.bytesLoaded*2) ) && loopBtn.selected ) { sourcePos = 0; } } ]]> </mx:Script> <mx:Button x="10" y="10" label="Load Audio" id="LoadAudioBtn" click="loadAudioFile()"/> <mx:CheckBox x="107" y="10" label="loop" id="loopBtn"/> <mx:VSlider x="60" y="55" minimum="0.0" maximum="1.2" snapInterval="0.05" value="1.0" id="leftSlider" /> <mx:VSlider x="92" y="55" minimum="0.0" maximum="1.2" snapInterval="0.05" value="1.0" id="righttSlider" /> </mx:WindowedApplication>