/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* perform sample-rate conversion if needed.
*
* @author Karl Helgason
*/
private static class AudioFloatFormatConverterInputStream extends
private float[] readfloatbuffer;
private final int fsize;
}
byte[] b = new byte[1];
if (ret < 0)
return ret;
return b[0] & 0xFF;
}
readfloatbuffer = new float[flen];
if (ret < 0)
return ret;
}
if (ret < 0)
return ret;
}
}
}
public boolean markSupported() {
return stream.markSupported();
}
}
if (ret < 0)
return ret;
}
}
private static class AudioFloatInputStreamChannelMixer extends
private final int targetChannels;
private final int sourceChannels;
private float[] conversion_buffer;
int targetChannels) {
this.targetChannels = targetChannels;
.isBigEndian());
}
}
}
return targetFormat;
}
public long getFrameLength() {
return ais.getFrameLength();
}
}
public boolean markSupported() {
return ais.markSupported();
}
conversion_buffer = new float[len2];
if (ret < 0)
return ret;
if (sourceChannels == 1) {
int cs = targetChannels;
for (int c = 0; c < targetChannels; c++) {
b[ix] = conversion_buffer[i];
}
}
} else if (targetChannels == 1) {
int cs = sourceChannels;
b[ix] = conversion_buffer[i];
}
for (int c = 1; c < sourceChannels; c++) {
b[ix] += conversion_buffer[i];
}
}
}
} else {
int ct = targetChannels;
int cs = sourceChannels;
for (int c = 0; c < minChannels; c++) {
b[i] = conversion_buffer[ix];
}
}
for (int c = minChannels; c < targetChannels; c++) {
b[i] = 0;
}
}
}
}
}
if (ret < 0)
return ret;
}
}
private static class AudioFloatInputStreamResampler extends
private float[] skipbuffer;
private final float[] ibuffer2;
private final float[][] ibuffer;
private final int nrofchannels;
private float[][] cbuffer;
private final int pad;
private final int pad2;
this.resampler = new SoftPointResampler();
this.resampler = new SoftLinearResampler2();
this.resampler = new SoftLinearResampler();
this.resampler = new SoftLinearResampler2();
this.resampler = new SoftCubicResampler();
this.resampler = new SoftLanczosResampler();
this.resampler = new SoftSincResampler();
}
// SoftLinearResampler2();
}
return 0;
}
}
return targetFormat;
}
public long getFrameLength() {
}
if (mark_ibuffer == null) {
}
float[] to = mark_ibuffer[c];
}
}
}
public boolean markSupported() {
return ais.markSupported();
}
if (ibuffer_len == -1)
return;
for (int c = 0; c < nrofchannels; c++) {
}
}
ibuffer_index -= (ibuffer_len);
if (ibuffer_len >= 0) {
- ibuffer_len);
if (ret == -1)
break;
ibuffer_len += ret;
}
} else {
}
for (int c = 0; c < nrofchannels; c++) {
}
}
}
}
if (ibuffer_len == -1)
return -1;
if (len < 0)
return 0;
int destPos = 0;
int in_end = ibuffer_len;
while (remain > 0) {
if (ibuffer_len >= 0) {
}
if (ibuffer_len < 0) {
if (ibuffer_index >= in_end)
break;
}
if (ibuffer_index < 0)
break;
int preDestPos = destPos;
for (int c = 0; c < nrofchannels; c++) {
}
}
for (int c = 0; c < nrofchannels; c++) {
int ix = 0;
}
}
}
if (mark_ibuffer == null)
return;
float[] from = mark_ibuffer[c];
}
}
}
if (len < 0)
return 0;
if (skipbuffer == null)
float[] l_skipbuffer = skipbuffer;
while (remain > 0) {
skipbuffer.length));
if (ret < 0) {
return ret;
break;
}
}
}
}
return sourceStream;
bits = 32;
}
throw new IllegalArgumentException("Unsupported conversion: "
+ targetFormat.toString());
}
throw new IllegalArgumentException("Unsupported conversion: "
+ targetFormat.toString());
.getChannels())
return new AudioInputStream(new AudioFloatFormatConverterInputStream(
.getFrameLength());
}
}
}
return new Encoding[0];
}
return new AudioFormat[0];
AudioSystem.NOT_SPECIFIED, false));
AudioSystem.NOT_SPECIFIED, false));
}
}
}
AudioSystem.NOT_SPECIFIED, false));
AudioSystem.NOT_SPECIFIED, true));
AudioSystem.NOT_SPECIFIED, false));
AudioSystem.NOT_SPECIFIED, true));
}
}
return false;
return false;
return false;
return false;
return true;
}
return false;
return true;
}
return false;
}
}