@Override
    public void stopSource(AudioSource src) {
        synchronized (threadLock) {
            if (audioDisabled) {
                return;
            }

            AudioData audioData = src.getAudioData();
            if (audioData == null) {
                logger.log(Level.WARNING, "stopSource called on source with null AudioData: {0}", src);
                return;
            }

            if (src.getStatus() != Status.Stopped) {
                int channel = src.getChannel();
                assert channel != -1; // if it's not stopped, must have id

                src.setStatus(Status.Stopped);
                src.setChannel(-1);
                clearChannel(channel);
                freeChannel(channel);

                if (src.getAudioData() instanceof AudioStream) {
                    // If the stream is seekable, rewind it to the beginning.
                    // Otherwise (non-seekable), close it, as it might be invalid now.
                    AudioStream stream = (AudioStream) src.getAudioData();
                    if (stream.isSeekable()) {
                        stream.setTime(0);
                    } else {
                        stream.close();
                    }
                }
            }
        }
    }
Stops a playing or paused audio source, releasing its channel.
For streams, resets or closes the stream.
@param src The audio source to stop.
jme3-core/src/main/java/com/jme3/audio/openal/ALAudioRenderer.java