net.sourceforge.javaflacencoder.ChannelData Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of javasound-flac Show documentation
Show all versions of javasound-flac Show documentation
A port of the Free Lossless Audio Codec (FLAC) decoder to Java and a FLAC encoder implemented in Java.
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package net.sourceforge.javaflacencoder;
/**
*
* @author preston
*/
public class ChannelData {
public enum ChannelName {
LEFT,
RIGHT,
MID,
SIDE,
INDEPENDENT
}
private int[] samples = null;
private int count;
private int sampleSize;
private ChannelName name;
public ChannelData(int[] samples, int count, int sampleSize, ChannelName n) {
this.count = count;
this.samples = samples;
this.sampleSize = sampleSize;
this.name = n;
}
public int[] getSamples() { return samples; }
public int getCount() { return count; }
public int getSampleSize() { return sampleSize; }
public ChannelName getChannelName() { return name; }
public int setData(int[] newSamples, int count, int sampleSize, ChannelName n) {
samples = newSamples;
this.sampleSize = sampleSize;
this.name = n;
return setCount(count);
}
public int setCount(int count) {
this.count = (count <= samples.length) ? count:samples.length;
return this.count;
}
public void setChannelName(ChannelName cn) {
this.name = cn;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy