In case Flash no longer exists; a copy of this site is included in the Flashpoint archive's "ultimate" collection.

Dead Code Preservation :: Archived AS3 works from wonderfl.net

SiON MML with Voice

Im trying to play an MML with any other voice but I cant, thanks in advance
Get Adobe Flash player
by Daniel.Aguilar.Fuentes 12 Oct 2012

    Talk

    keim_at_Si at 26 Nov 2012 11:34
    // set voice#0 in driver var tono:String = tonos[stIntrumento.value]; var numtono:String = numtonos[stIntrumento.value]; instrumento = presets["valsound."+tono+numtono]; driver.setVoice(0,instrumento); /* here's a essence how to change the voice in mml. "%6@0" sets voice as FM voice #0 in a driver or data. see "%" and "@" command in mml reference http://mmltalks.appspot.com/document/siopm_mml_ref_05_e.html */ var mmlWithVoiceRefer:String = "%6@0" + txtMelodia.text; var sdata:SiONData = driver.compile(mmlWithVoiceRefer); driver.play(sdata);

    Tags

    Embed
/**
 * Copyright Daniel.Aguilar.Fuentes ( http://wonderfl.net/user/Daniel.Aguilar.Fuentes )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/ifWY
 */

package {
    import flash.display.Sprite;
    public class FlashTest extends Sprite {
        public function FlashTest() {
            // Im trying to play a mml string with any other instrument than default, any ideas?
            
            /*var tono:String = tonos[stIntrumento.value];

                var numtono:String = numtonos[stIntrumento.value];

                instrumento = presets["valsound."+tono+numtono];

                driver.setVoice(0,instrumento);

                var tdata:SiONData = new SiONData();

                tdata.setPCMVoice(0,instrumento);

                sdata= driver.compile(txtMelodia.text,tdata);

                sdata.setPCMVoice(0,instrumento);

                driver.play(sdata);*/
        }
    }
}