Example usage for javax.sound.sampled Mixer close

List of usage examples for javax.sound.sampled Mixer close

Introduction

In this page you can find the example usage for javax.sound.sampled Mixer close.

Prototype

@Override
void close();

Source Link

Document

Closes the line, indicating that any system resources in use by the line can be released.

Usage

From source file:SoundManagerTest.java

/**
 * Does any clean up before closing.//from  w  w  w .j  a  v  a  2s  .  c om
 */
protected void cleanUp() {
    // signal to unpause
    setPaused(false);

    // close the mixer (stops any running sounds)
    Mixer mixer = AudioSystem.getMixer(null);
    if (mixer.isOpen()) {
        mixer.close();
    }
}