Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (102)
JavaBeans (21)
JDBC (121)
JDK (426)
JSP (20)
Logging (108)
Mail (58)
Messaging (8)
Network (84)
PDF (97)
Report (7)
Scripting (84)
Security (32)
Server (121)
Servlet (26)
SOAP (24)
Testing (54)
Web (15)
XML (322)
Collections:
Other Resources:
JDK 11 java.desktop.jmod - Desktop Module
JDK 11 java.desktop.jmod is the JMOD file for JDK 11 Desktop module.
JDK 11 Desktop module compiled class files are stored in \fyicenter\jdk-11.0.1\jmods\java.desktop.jmod.
JDK 11 Desktop module compiled class files are also linked and stored in the \fyicenter\jdk-11.0.1\lib\modules JImage file.
JDK 11 Desktop module source code files are stored in \fyicenter\jdk-11.0.1\lib\src.zip\java.desktop.
You can click and view the content of each source code file in the list below.
✍: FYIcenter
⏎ com/sun/media/sound/SoftLimiter.java
/*
* Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved.
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*/
package com.sun.media.sound;
/**
* A simple look-ahead volume limiter with very fast attack and fast release.
* This filter is used for preventing clipping.
*
* @author Karl Helgason
*/
public final class SoftLimiter implements SoftAudioProcessor {
float lastmax = 0;
float gain = 1;
float[] temp_bufferL;
float[] temp_bufferR;
boolean mix = false;
SoftAudioBuffer bufferL;
SoftAudioBuffer bufferR;
SoftAudioBuffer bufferLout;
SoftAudioBuffer bufferRout;
float controlrate;
@Override
public void init(float samplerate, float controlrate) {
this.controlrate = controlrate;
}
@Override
public void setInput(int pin, SoftAudioBuffer input) {
if (pin == 0)
bufferL = input;
if (pin == 1)
bufferR = input;
}
@Override
public void setOutput(int pin, SoftAudioBuffer output) {
if (pin == 0)
bufferLout = output;
if (pin == 1)
bufferRout = output;
}
@Override
public void setMixMode(boolean mix) {
this.mix = mix;
}
@Override
public void globalParameterControlChange(int[] slothpath, long param,
long value) {
}
double silentcounter = 0;
@Override
public void processAudio() {
if (this.bufferL.isSilent()
&& (this.bufferR == null || this.bufferR.isSilent())) {
silentcounter += 1 / controlrate;
if (silentcounter > 60) {
if (!mix) {
bufferLout.clear();
if (bufferRout != null) bufferRout.clear();
}
return;
}
} else
silentcounter = 0;
float[] bufferL = this.bufferL.array();
float[] bufferR = this.bufferR == null ? null : this.bufferR.array();
float[] bufferLout = this.bufferLout.array();
float[] bufferRout = this.bufferRout == null
? null : this.bufferRout.array();
if (temp_bufferL == null || temp_bufferL.length < bufferL.length)
temp_bufferL = new float[bufferL.length];
if (bufferR != null)
if (temp_bufferR == null || temp_bufferR.length < bufferR.length)
temp_bufferR = new float[bufferR.length];
float max = 0;
int len = bufferL.length;
if (bufferR == null) {
for (int i = 0; i < len; i++) {
if (bufferL[i] > max)
max = bufferL[i];
if (-bufferL[i] > max)
max = -bufferL[i];
}
} else {
for (int i = 0; i < len; i++) {
if (bufferL[i] > max)
max = bufferL[i];
if (bufferR[i] > max)
max = bufferR[i];
if (-bufferL[i] > max)
max = -bufferL[i];
if (-bufferR[i] > max)
max = -bufferR[i];
}
}
float lmax = lastmax;
lastmax = max;
if (lmax > max)
max = lmax;
float newgain = 1;
if (max > 0.99f)
newgain = 0.99f / max;
else
newgain = 1;
if (newgain > gain)
newgain = (newgain + gain * 9) / 10f;
float gaindelta = (newgain - gain) / len;
if (mix) {
if (bufferR == null) {
for (int i = 0; i < len; i++) {
gain += gaindelta;
float bL = bufferL[i];
float tL = temp_bufferL[i];
temp_bufferL[i] = bL;
bufferLout[i] += tL * gain;
}
} else {
for (int i = 0; i < len; i++) {
gain += gaindelta;
float bL = bufferL[i];
float bR = bufferR[i];
float tL = temp_bufferL[i];
float tR = temp_bufferR[i];
temp_bufferL[i] = bL;
temp_bufferR[i] = bR;
bufferLout[i] += tL * gain;
bufferRout[i] += tR * gain;
}
}
} else {
if (bufferR == null) {
for (int i = 0; i < len; i++) {
gain += gaindelta;
float bL = bufferL[i];
float tL = temp_bufferL[i];
temp_bufferL[i] = bL;
bufferLout[i] = tL * gain;
}
} else {
for (int i = 0; i < len; i++) {
gain += gaindelta;
float bL = bufferL[i];
float bR = bufferR[i];
float tL = temp_bufferL[i];
float tR = temp_bufferR[i];
temp_bufferL[i] = bL;
temp_bufferR[i] = bR;
bufferLout[i] = tL * gain;
bufferRout[i] = tR * gain;
}
}
}
gain = newgain;
}
@Override
public void processControlLogic() {
}
}
⏎ com/sun/media/sound/SoftLimiter.java
Or download all of them as a single archive file:
File name: java.desktop-11.0.1-src.zip File size: 7974380 bytes Release date: 2018-11-04 Download
⇒ JDK 11 java.instrument.jmod - Instrument Module
2022-08-06, ≈455🔥, 5💬
Popular Posts:
Provides a simple high-level Http server API, which can be used to build embedded HTTP servers. Both...
Jackson is "the Java JSON library" or "the best JSON parser for Java". Or simply as "JSON for Java"....
Apache Commons CLI Source Code Files are provided in the source package file commons-cli-1.5.0-sourc. ..
Java Advanced Imaging (JAI) is a Java platform extension API that provides a set of object-oriented ...
JDK 11 java.sql.rowset.jmod is the JMOD file for JDK 11 SQL Rowset module. JDK 11 SQL Rowset module ...