Initial commit

This commit is contained in:
2017-04-18 18:25:45 -05:00
commit fa87f5e8cf
176 changed files with 7413 additions and 0 deletions

View File

@@ -0,0 +1,55 @@
package zero1hd.polyjet.audio;
import javax.sound.sampled.AudioFormat;
import com.badlogic.gdx.audio.Music;
import com.badlogic.gdx.files.FileHandle;
public interface AudioData {
/**
* sets a integer variable to the current window of audio data the playback is at.
* Useful for efficiency because we compute once for that frame then get the values everytime it is required instead of calculating every time we get the index.
*/
public void readIndexUpdate();
/**
* Gets the current position in seconds
* @return the current frame of audio.
*/
public int getReadIndex();
/**
* Sets the current audio file
*/
public void setAudioFile(FileHandle setAudio);
/**
* Completely resets the current audio data. Think of pooling, except, only one instance which is reused instead of multiple.
*/
public void reset();
/**
* returns the read window size.
* @return
*/
public int getReadWindowSize();
/**
* Gets the object to play the music. Contains playback data.
* @return
*/
public Music getPlaybackMusic();
/**
* read in samples and fills the array.
* @param samples the array that should contain said samples
* @return amount read. Will return 0 if end of stream.
*/
public int readSamples(float[] samples);
/**
* Returns properly setup AudioFormat object.
* @return
*/
public AudioFormat getFormat();
}