added AudioBuffer

This commit is contained in:
DaniTheSkunk 2022-10-13 06:04:48 +00:00
parent 87b3faaa81
commit f96b2802f6
1 changed files with 28 additions and 0 deletions

View File

@ -0,0 +1,28 @@
package com.danitheskunk.skunkworks.audio;
public class AudioBuffer {
private double[] left;
private double[] right;
public AudioBuffer(int size) {
left = new double[size];
right = new double[size];
}
public int getSize() {
return left.length;
}
public void setSample(int pos, double left, double right) {
this.left[pos] = left;
this.right[pos] = right;
}
public double getLeft(int pos) {
return left[pos];
}
public double getRight(int pos) {
return right[pos];
}
}