Examples of SF2Sample


Examples of com.sun.media.sound.SF2Sample

        AudioInputStream stream = synth.openStream(format, p);
                       
        // Create instrument with too many regions (more than max polyphony)
        SF2Soundbank sf2 = new SF2Soundbank();
       
        SF2Sample sample = new SF2Sample(sf2);
        sample.setName("test sample");
        sample.setData(new byte[100]);
        sample.setSampleRate(44100);
        sample.setOriginalPitch(20);
        sf2.addResource(sample);       
       
        SF2Layer layer = new SF2Layer(sf2);
        layer.setName("test layer");
        sf2.addResource(layer);
View Full Code Here

Examples of com.sun.media.sound.SF2Sample

        Arrays.fill(data, 0);
        data[0] = 1.0f;
        byte[] bdata = new byte[data.length * format.getFrameSize()];
        AudioFloatConverter.getConverter(format).toByteArray(data, bdata);

        SF2Sample sample = new SF2Sample(soundbank);
        sample.setName("Test Sample");
        sample.setData(bdata);
        sample.setSampleRate((long) format.getSampleRate());
        sample.setOriginalPitch(69);
        soundbank.addResource(sample);

        SF2Layer layer = new SF2Layer(soundbank);
        layer.setName("Test Layer");
        soundbank.addResource(layer);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.