/* Spesification: * Implementing classes must return the frameRate and the length of the decompressed sound * in getFrameRate() and getLength() */ abstract class AbstractCompressedSound implements java.io.Serializable { protected double sampleRate; protected int length; // in samples // sets the variables length and frameRate to the same as original // this will not always be the correct action, and somtimes these // values must be set to the correct value in the constructor of // the implementing class AbstractCompressedSound(MatInf1100Sound original) { sampleRate = original.sampleRate; length = original.samples.length; } public void play() throws Exception { decompress().play(); } abstract public MatInf1100Sound decompress(); abstract public boolean isLossless(); public double getFrameRate() { return sampleRate; } public double getLength() { return length; } }