Java 类javax.sound.midi.VoiceStatus 实例源码

项目:OpenJSharp    文件:ModelAbstractOscillator.java   
public void noteOn(MidiChannel channel, VoiceStatus voice, int noteNumber,
        int velocity) {
    this.channel = channel;
    this.voice = voice;
    this.noteNumber = noteNumber;
    this.velocity = velocity;
    on = true;
}
项目:jdk8u-jdk    文件:ModelAbstractOscillator.java   
public void noteOn(MidiChannel channel, VoiceStatus voice, int noteNumber,
        int velocity) {
    this.channel = channel;
    this.voice = voice;
    this.noteNumber = noteNumber;
    this.velocity = velocity;
    on = true;
}
项目:jdk8u-jdk    文件:NoteOverFlowTest.java   
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
    for (int i = 0; i < synth.getMaxPolyphony(); i++) {
        ch1.noteOn(64, 64);
        ch1.noteOff(64);
    }

    // Now send single midi on, and midi off message
    ch1.noteOn(64, 64);
    ch1.noteOff(64);

    // Read 10 sec from stream, by this time all voices should be inactvie
    stream.skip(format.getFrameSize() * ((int)(format.getFrameRate() * 20)));

    // If no voice are active, then this test will pass
    VoiceStatus[] v = synth.getVoiceStatus();
    for (int i = 0; i < v.length; i++) {
        if(v[i].active)
        {
            throw new RuntimeException("Not all voices are inactive!");
        }
    }

    // Close the synthesizer after use
    synth.close();
}
项目:jdk8u-jdk    文件:GetVoiceStatus.java   
public static void main(String[] args) throws Exception {
    AudioSynthesizer synth = new SoftSynthesizer();
    synth.openStream(null, null);
    VoiceStatus[] v = synth.getVoiceStatus();
    assertTrue(v != null);
    assertTrue(synth.getChannels().length != synth.getMaxPolyphony());
    synth.close();

}
项目:openjdk-jdk10    文件:ModelAbstractOscillator.java   
@Override
public void noteOn(MidiChannel channel, VoiceStatus voice, int noteNumber,
                   int velocity) {
    this.channel = channel;
    this.voice = voice;
    this.noteNumber = noteNumber;
    this.velocity = velocity;
    on = true;
}
项目:openjdk-jdk10    文件:NoteOverFlowTest.java   
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
    for (int i = 0; i < synth.getMaxPolyphony(); i++) {
        ch1.noteOn(64, 64);
        ch1.noteOff(64);
    }

    // Now send single midi on, and midi off message
    ch1.noteOn(64, 64);
    ch1.noteOff(64);

    // Read 10 sec from stream, by this time all voices should be inactvie
    stream.skip(format.getFrameSize() * ((int)(format.getFrameRate() * 20)));

    // If no voice are active, then this test will pass
    VoiceStatus[] v = synth.getVoiceStatus();
    for (int i = 0; i < v.length; i++) {
        if(v[i].active)
        {
            throw new RuntimeException("Not all voices are inactive!");
        }
    }

    // Close the synthesizer after use
    synth.close();
}
项目:openjdk-jdk10    文件:GetVoiceStatus.java   
public static void main(String[] args) throws Exception {
    AudioSynthesizer synth = new SoftSynthesizer();
    synth.openStream(null, null);
    VoiceStatus[] v = synth.getVoiceStatus();
    assertTrue(v != null);
    assertTrue(synth.getChannels().length != synth.getMaxPolyphony());
    synth.close();

}
项目:openjdk9    文件:ModelAbstractOscillator.java   
public void noteOn(MidiChannel channel, VoiceStatus voice, int noteNumber,
        int velocity) {
    this.channel = channel;
    this.voice = voice;
    this.noteNumber = noteNumber;
    this.velocity = velocity;
    on = true;
}
项目:openjdk9    文件:NoteOverFlowTest.java   
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
    for (int i = 0; i < synth.getMaxPolyphony(); i++) {
        ch1.noteOn(64, 64);
        ch1.noteOff(64);
    }

    // Now send single midi on, and midi off message
    ch1.noteOn(64, 64);
    ch1.noteOff(64);

    // Read 10 sec from stream, by this time all voices should be inactvie
    stream.skip(format.getFrameSize() * ((int)(format.getFrameRate() * 20)));

    // If no voice are active, then this test will pass
    VoiceStatus[] v = synth.getVoiceStatus();
    for (int i = 0; i < v.length; i++) {
        if(v[i].active)
        {
            throw new RuntimeException("Not all voices are inactive!");
        }
    }

    // Close the synthesizer after use
    synth.close();
}
项目:openjdk9    文件:GetVoiceStatus.java   
public static void main(String[] args) throws Exception {
    AudioSynthesizer synth = new SoftSynthesizer();
    synth.openStream(null, null);
    VoiceStatus[] v = synth.getVoiceStatus();
    assertTrue(v != null);
    assertTrue(synth.getChannels().length != synth.getMaxPolyphony());
    synth.close();

}
项目:jdk8u_jdk    文件:ModelAbstractOscillator.java   
public void noteOn(MidiChannel channel, VoiceStatus voice, int noteNumber,
        int velocity) {
    this.channel = channel;
    this.voice = voice;
    this.noteNumber = noteNumber;
    this.velocity = velocity;
    on = true;
}
项目:jdk8u_jdk    文件:NoteOverFlowTest.java   
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
    for (int i = 0; i < synth.getMaxPolyphony(); i++) {
        ch1.noteOn(64, 64);
        ch1.noteOff(64);
    }

    // Now send single midi on, and midi off message
    ch1.noteOn(64, 64);
    ch1.noteOff(64);

    // Read 10 sec from stream, by this time all voices should be inactvie
    stream.skip(format.getFrameSize() * ((int)(format.getFrameRate() * 20)));

    // If no voice are active, then this test will pass
    VoiceStatus[] v = synth.getVoiceStatus();
    for (int i = 0; i < v.length; i++) {
        if(v[i].active)
        {
            throw new RuntimeException("Not all voices are inactive!");
        }
    }

    // Close the synthesizer after use
    synth.close();
}
项目:jdk8u_jdk    文件:GetVoiceStatus.java   
public static void main(String[] args) throws Exception {
    AudioSynthesizer synth = new SoftSynthesizer();
    synth.openStream(null, null);
    VoiceStatus[] v = synth.getVoiceStatus();
    assertTrue(v != null);
    assertTrue(synth.getChannels().length != synth.getMaxPolyphony());
    synth.close();

}
项目:lookaside_java-1.8.0-openjdk    文件:ModelAbstractOscillator.java   
public void noteOn(MidiChannel channel, VoiceStatus voice, int noteNumber,
        int velocity) {
    this.channel = channel;
    this.voice = voice;
    this.noteNumber = noteNumber;
    this.velocity = velocity;
    on = true;
}
项目:lookaside_java-1.8.0-openjdk    文件:NoteOverFlowTest.java   
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
    for (int i = 0; i < synth.getMaxPolyphony(); i++) {
        ch1.noteOn(64, 64);
        ch1.noteOff(64);
    }

    // Now send single midi on, and midi off message
    ch1.noteOn(64, 64);
    ch1.noteOff(64);

    // Read 10 sec from stream, by this time all voices should be inactvie
    stream.skip(format.getFrameSize() * ((int)(format.getFrameRate() * 20)));

    // If no voice are active, then this test will pass
    VoiceStatus[] v = synth.getVoiceStatus();
    for (int i = 0; i < v.length; i++) {
        if(v[i].active)
        {
            throw new RuntimeException("Not all voices are inactive!");
        }
    }

    // Close the synthesizer after use
    synth.close();
}
项目:lookaside_java-1.8.0-openjdk    文件:GetVoiceStatus.java   
public static void main(String[] args) throws Exception {
    AudioSynthesizer synth = new SoftSynthesizer();
    synth.openStream(null, null);
    VoiceStatus[] v = synth.getVoiceStatus();
    assertTrue(v != null);
    assertTrue(synth.getChannels().length != synth.getMaxPolyphony());
    synth.close();

}
项目:TuxGuitar-1.3.1-fork    文件:ModelAbstractOscillator.java   
public void noteOn(MidiChannel channel, VoiceStatus voice, int noteNumber,
        int velocity) {
    this.channel = channel;
    this.voice = voice;
    this.noteNumber = noteNumber;
    this.velocity = velocity;
    on = true;
}
项目:infobip-open-jdk-8    文件:ModelAbstractOscillator.java   
public void noteOn(MidiChannel channel, VoiceStatus voice, int noteNumber,
        int velocity) {
    this.channel = channel;
    this.voice = voice;
    this.noteNumber = noteNumber;
    this.velocity = velocity;
    on = true;
}
项目:infobip-open-jdk-8    文件:NoteOverFlowTest.java   
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
    for (int i = 0; i < synth.getMaxPolyphony(); i++) {
        ch1.noteOn(64, 64);
        ch1.noteOff(64);
    }

    // Now send single midi on, and midi off message
    ch1.noteOn(64, 64);
    ch1.noteOff(64);

    // Read 10 sec from stream, by this time all voices should be inactvie
    stream.skip(format.getFrameSize() * ((int)(format.getFrameRate() * 20)));

    // If no voice are active, then this test will pass
    VoiceStatus[] v = synth.getVoiceStatus();
    for (int i = 0; i < v.length; i++) {
        if(v[i].active)
        {
            throw new RuntimeException("Not all voices are inactive!");
        }
    }

    // Close the synthesizer after use
    synth.close();
}
项目:infobip-open-jdk-8    文件:GetVoiceStatus.java   
public static void main(String[] args) throws Exception {
    AudioSynthesizer synth = new SoftSynthesizer();
    synth.openStream(null, null);
    VoiceStatus[] v = synth.getVoiceStatus();
    assertTrue(v != null);
    assertTrue(synth.getChannels().length != synth.getMaxPolyphony());
    synth.close();

}
项目:jdk8u-dev-jdk    文件:ModelAbstractOscillator.java   
public void noteOn(MidiChannel channel, VoiceStatus voice, int noteNumber,
        int velocity) {
    this.channel = channel;
    this.voice = voice;
    this.noteNumber = noteNumber;
    this.velocity = velocity;
    on = true;
}
项目:jdk8u-dev-jdk    文件:NoteOverFlowTest.java   
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
    for (int i = 0; i < synth.getMaxPolyphony(); i++) {
        ch1.noteOn(64, 64);
        ch1.noteOff(64);
    }

    // Now send single midi on, and midi off message
    ch1.noteOn(64, 64);
    ch1.noteOff(64);

    // Read 10 sec from stream, by this time all voices should be inactvie
    stream.skip(format.getFrameSize() * ((int)(format.getFrameRate() * 20)));

    // If no voice are active, then this test will pass
    VoiceStatus[] v = synth.getVoiceStatus();
    for (int i = 0; i < v.length; i++) {
        if(v[i].active)
        {
            throw new RuntimeException("Not all voices are inactive!");
        }
    }

    // Close the synthesizer after use
    synth.close();
}
项目:jdk8u-dev-jdk    文件:GetVoiceStatus.java   
public static void main(String[] args) throws Exception {
    AudioSynthesizer synth = new SoftSynthesizer();
    synth.openStream(null, null);
    VoiceStatus[] v = synth.getVoiceStatus();
    assertTrue(v != null);
    assertTrue(synth.getChannels().length != synth.getMaxPolyphony());
    synth.close();

}
项目:jdk7-jdk    文件:ModelAbstractOscillator.java   
public void noteOn(MidiChannel channel, VoiceStatus voice, int noteNumber,
        int velocity) {
    this.channel = channel;
    this.voice = voice;
    this.noteNumber = noteNumber;
    this.velocity = velocity;
    on = true;
}
项目:jdk7-jdk    文件:NoteOverFlowTest.java   
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
    for (int i = 0; i < synth.getMaxPolyphony(); i++) {
        ch1.noteOn(64, 64);
        ch1.noteOff(64);
    }

    // Now send single midi on, and midi off message
    ch1.noteOn(64, 64);
    ch1.noteOff(64);

    // Read 10 sec from stream, by this time all voices should be inactvie
    stream.skip(format.getFrameSize() * ((int)(format.getFrameRate() * 20)));

    // If no voice are active, then this test will pass
    VoiceStatus[] v = synth.getVoiceStatus();
    for (int i = 0; i < v.length; i++) {
        if(v[i].active)
        {
            throw new RuntimeException("Not all voices are inactive!");
        }
    }

    // Close the synthesizer after use
    synth.close();
}
项目:jdk7-jdk    文件:GetVoiceStatus.java   
public static void main(String[] args) throws Exception {
    AudioSynthesizer synth = new SoftSynthesizer();
    synth.openStream(null, null);
    VoiceStatus[] v = synth.getVoiceStatus();
    assertTrue(v != null);
    assertTrue(synth.getChannels().length != synth.getMaxPolyphony());
    synth.close();

}
项目:openjdk-source-code-learn    文件:ModelAbstractOscillator.java   
public void noteOn(MidiChannel channel, VoiceStatus voice, int noteNumber,
        int velocity) {
    this.channel = channel;
    this.voice = voice;
    this.noteNumber = noteNumber;
    this.velocity = velocity;
    on = true;
}
项目:openjdk-source-code-learn    文件:NoteOverFlowTest.java   
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
    for (int i = 0; i < synth.getMaxPolyphony(); i++) {
        ch1.noteOn(64, 64);
        ch1.noteOff(64);
    }

    // Now send single midi on, and midi off message
    ch1.noteOn(64, 64);
    ch1.noteOff(64);

    // Read 10 sec from stream, by this time all voices should be inactvie
    stream.skip(format.getFrameSize() * ((int)(format.getFrameRate() * 20)));

    // If no voice are active, then this test will pass
    VoiceStatus[] v = synth.getVoiceStatus();
    for (int i = 0; i < v.length; i++) {
        if(v[i].active)
        {
            throw new RuntimeException("Not all voices are inactive!");
        }
    }

    // Close the synthesizer after use
    synth.close();
}
项目:openjdk-source-code-learn    文件:GetVoiceStatus.java   
public static void main(String[] args) throws Exception {
    AudioSynthesizer synth = new SoftSynthesizer();
    synth.openStream(null, null);
    VoiceStatus[] v = synth.getVoiceStatus();
    assertTrue(v != null);
    assertTrue(synth.getChannels().length != synth.getMaxPolyphony());
    synth.close();

}
项目:OLD-OpenJDK8    文件:ModelAbstractOscillator.java   
public void noteOn(MidiChannel channel, VoiceStatus voice, int noteNumber,
        int velocity) {
    this.channel = channel;
    this.voice = voice;
    this.noteNumber = noteNumber;
    this.velocity = velocity;
    on = true;
}
项目:OLD-OpenJDK8    文件:NoteOverFlowTest.java   
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
    for (int i = 0; i < synth.getMaxPolyphony(); i++) {
        ch1.noteOn(64, 64);
        ch1.noteOff(64);
    }

    // Now send single midi on, and midi off message
    ch1.noteOn(64, 64);
    ch1.noteOff(64);

    // Read 10 sec from stream, by this time all voices should be inactvie
    stream.skip(format.getFrameSize() * ((int)(format.getFrameRate() * 20)));

    // If no voice are active, then this test will pass
    VoiceStatus[] v = synth.getVoiceStatus();
    for (int i = 0; i < v.length; i++) {
        if(v[i].active)
        {
            throw new RuntimeException("Not all voices are inactive!");
        }
    }

    // Close the synthesizer after use
    synth.close();
}
项目:OLD-OpenJDK8    文件:GetVoiceStatus.java   
public static void main(String[] args) throws Exception {
    AudioSynthesizer synth = new SoftSynthesizer();
    synth.openStream(null, null);
    VoiceStatus[] v = synth.getVoiceStatus();
    assertTrue(v != null);
    assertTrue(synth.getChannels().length != synth.getMaxPolyphony());
    synth.close();

}
项目:JAVA_UNIT    文件:NoteOverFlowTest.java   
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
    for (int i = 0; i < synth.getMaxPolyphony(); i++) {
        ch1.noteOn(64, 64);
        ch1.noteOff(64);
    }

    // Now send single midi on, and midi off message
    ch1.noteOn(64, 64);
    ch1.noteOff(64);

    // Read 10 sec from stream, by this time all voices should be inactvie
    stream.skip(format.getFrameSize() * ((int)(format.getFrameRate() * 20)));

    // If no voice are active, then this test will pass
    VoiceStatus[] v = synth.getVoiceStatus();
    for (int i = 0; i < v.length; i++) {
        if(v[i].active)
        {
            throw new RuntimeException("Not all voices are inactive!");
        }
    }

    // Close the synthesizer after use
    synth.close();
}
项目:JAVA_UNIT    文件:GetVoiceStatus.java   
public static void main(String[] args) throws Exception {
    AudioSynthesizer synth = new SoftSynthesizer();
    synth.openStream(null, null);
    VoiceStatus[] v = synth.getVoiceStatus();
    assertTrue(v != null);
    assertTrue(synth.getChannels().length != synth.getMaxPolyphony());
    synth.close();

}
项目:openjdk-jdk7u-jdk    文件:ModelAbstractOscillator.java   
public void noteOn(MidiChannel channel, VoiceStatus voice, int noteNumber,
        int velocity) {
    this.channel = channel;
    this.voice = voice;
    this.noteNumber = noteNumber;
    this.velocity = velocity;
    on = true;
}
项目:openjdk-jdk7u-jdk    文件:NoteOverFlowTest.java   
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
    for (int i = 0; i < synth.getMaxPolyphony(); i++) {
        ch1.noteOn(64, 64);
        ch1.noteOff(64);
    }

    // Now send single midi on, and midi off message
    ch1.noteOn(64, 64);
    ch1.noteOff(64);

    // Read 10 sec from stream, by this time all voices should be inactvie
    stream.skip(format.getFrameSize() * ((int)(format.getFrameRate() * 20)));

    // If no voice are active, then this test will pass
    VoiceStatus[] v = synth.getVoiceStatus();
    for (int i = 0; i < v.length; i++) {
        if(v[i].active)
        {
            throw new RuntimeException("Not all voices are inactive!");
        }
    }

    // Close the synthesizer after use
    synth.close();
}
项目:openjdk-jdk7u-jdk    文件:GetVoiceStatus.java   
public static void main(String[] args) throws Exception {
    AudioSynthesizer synth = new SoftSynthesizer();
    synth.openStream(null, null);
    VoiceStatus[] v = synth.getVoiceStatus();
    assertTrue(v != null);
    assertTrue(synth.getChannels().length != synth.getMaxPolyphony());
    synth.close();

}
项目:openjdk-icedtea7    文件:ModelAbstractOscillator.java   
public void noteOn(MidiChannel channel, VoiceStatus voice, int noteNumber,
        int velocity) {
    this.channel = channel;
    this.voice = voice;
    this.noteNumber = noteNumber;
    this.velocity = velocity;
    on = true;
}
项目:openjdk-icedtea7    文件:NoteOverFlowTest.java   
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
    for (int i = 0; i < synth.getMaxPolyphony(); i++) {
        ch1.noteOn(64, 64);
        ch1.noteOff(64);
    }

    // Now send single midi on, and midi off message
    ch1.noteOn(64, 64);
    ch1.noteOff(64);

    // Read 10 sec from stream, by this time all voices should be inactvie
    stream.skip(format.getFrameSize() * ((int)(format.getFrameRate() * 20)));

    // If no voice are active, then this test will pass
    VoiceStatus[] v = synth.getVoiceStatus();
    for (int i = 0; i < v.length; i++) {
        if(v[i].active)
        {
            throw new RuntimeException("Not all voices are inactive!");
        }
    }

    // Close the synthesizer after use
    synth.close();
}
项目:openjdk-icedtea7    文件:GetVoiceStatus.java   
public static void main(String[] args) throws Exception {
    AudioSynthesizer synth = new SoftSynthesizer();
    synth.openStream(null, null);
    VoiceStatus[] v = synth.getVoiceStatus();
    assertTrue(v != null);
    assertTrue(synth.getChannels().length != synth.getMaxPolyphony());
    synth.close();

}