package zero1hd.rhythmbullet.audio.processor;

import com.badlogic.gdx.files.FileHandle;
import com.badlogic.gdx.utils.Disposable;

public interface AudioProcessor extends Disposable {
	/**
	 * @return number of channels
	 */
	public boolean isStereo();
	
	/**
	 * @return sample rate
	 */
	public int getSampleRate();
	
	/**
	 * Reads samples with interwoven data for stereo.
	 * stored in 16 bit format (first 8 are the first byte of data while the second 8 are the second byte of data that composes a short value) 
	 * @param pcm the array the samples should fill
	 * @return the amount of samples read.
	 */
	public int readSamples(short[] pcm);
	
	/**
	 * Reads frames with interwoven data for stereo.
	 * stored in 16 bit format (first 8 are the first byte of data while the second 8 are the second byte of data that composes a short value)
	 * @param pcm the array the samples should fill
	 * @return the amount of samples read.
	 */
	public int readFrames(float[] pcm);
	
	/**
	 * 
	 * @return The music file's {@link FileHandle}
	 */
	public FileHandle getMusicFileHandle();
	
	/**
	 * 
	 * @return the number of sample frames in the song.
	 */
	public long getSampleFrames();
}
