SiON setSamplerSound/setPCMSound
mp3をSiONで鳴らしたい程度が上手くいかないです
正直ASとか初めてなので自分のポカとしか思えないです
setSamplerSoundとかの使い方間違えてる気がします
♥0 |
Line 32 |
Modified 2010-03-02 16:18:43 |
MIT License
archived:2017-03-10 14:14:24
ActionScript3 source code
/**
* Copyright SOU1 ( http://wonderfl.net/user/SOU1 )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/hMjb
*/
// mp3をSiONで鳴らしたい程度が上手くいかないです
// 正直ASとか初めてなので自分のポカとしか思えないです
// setSamplerSoundとかの使い方間違えてる気がします
package {
import flash.display.Sprite;
import flash.text.TextField;
import flash.text.TextFieldAutoSize;
import flash.media.*;
import flash.net.*;
import flash.events.Event;
import org.si.sion.*;
public class FlashTest extends Sprite {
private function loadSound(url:String):void
{
var tf :TextField = new TextField;
tf.text=url;
tf.autoSize = TextFieldAutoSize.LEFT;
addChild( tf );
}
public function FlashTest() {
// write as3 code here..
var driver:SiONDriver = new SiONDriver();
var mml:SiONData;
var pcmsound:SiONVoice = new SiONVoice(10);
var FlashVars:Object = loaderInfo.parameters;
var url:String = FlashVars["url"];
if (url){}else{url="http://s1224.com/music/sw/trancelike_state.mp3"};
loadSound(url);
var loadData:String = "http://s1224.com/music/sw/trancelike_state.mp3";
var source:Sound = new Sound();
source.load(new URLRequest(loadData));
//mml = driver.compile("#EFFECT{delay120,40};t144%3@5v32l16>[eb<g]5>[f+<d|a]6>[g<d|b]9<c>>g<d<d>d<d>[cg<e]5>g[da<|e]3[d>|da]3a[ea<e]5>[eb|<e]6>>[eb<g]5>[f+<d|a]6>[g<d|b]9<c>>g<d<d>d<d>[cg<e]5>g[da<|e]3[d>|da]3a[ea<e]5>[eb|<e]6;");
//driver.setPCMSound(0,source,5,1048576);
//mml = driver.compile("%7@0c");
driver.setSamplerSound(60,source,true,2,10000000);
//mml = driver.compile("%10@0c");
//driver.play();
driver.noteOn(60, pcmsound, 2);
//driver.playSound(60,0,0);
//source.play();
}
}
}