Package com.sun.media.sound

Examples of com.sun.media.sound.SoftSynthesizer.openStream()


    public static void test(Soundbank soundbank) throws Exception {

        // Create instance of synthesizer using the testing soundbank above
        AudioSynthesizer synth = new SoftSynthesizer();
        AudioInputStream stream = synth.openStream(format, null);
        synth.unloadAllInstruments(synth.getDefaultSoundbank());
        synth.loadAllInstruments(soundbank);
        Receiver recv = synth.getReceiver();

        // Set volume to max and turn reverb off
View Full Code Here


        // Create instance of the synthesizer with very low polyphony
        AudioSynthesizer synth = new SoftSynthesizer();
        AudioFormat format = new AudioFormat(44100, 16, 2, true, false);
        Map<String, Object> p = new HashMap<String, Object>();
        p.put("max polyphony", new Integer(5));
        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);
View Full Code Here

    public static void main(String[] args) throws Exception
    {       
        AudioSynthesizer synth = new SoftSynthesizer();
        AudioFormat format = new AudioFormat(44100, 16, 2, true, false);
        AudioInputStream stream = synth.openStream(format, null);
                       
        // Make all voices busy, e.g.
        // send midi on and midi off on all available voices       
        MidiChannel ch1 = synth.getChannels()[0];
        ch1.programChange(48); // Use contionus instrument like string ensemble
View Full Code Here

public class GetMidiDevice {

    public static void main(String[] args) throws Exception {

        AudioSynthesizer synth = new SoftSynthesizer();
        synth.openStream(null, null);
        Receiver recv = synth.getReceiver();
        if (((SoftReceiver) recv).getMidiDevice() != synth) {
            throw new Exception("SoftReceiver.getMidiDevice() doesn't return "
                    + "instance of the synthesizer");
        }
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.