uk.org.toot.demo
Class AudioFilePlayerProcess

java.lang.Object
  extended by uk.org.toot.demo.AudioFilePlayerProcess
All Implemented Interfaces:
uk.org.toot.audio.core.AudioProcess
Direct Known Subclasses:
MultiTrackPlayer.PlayerProcess

public class AudioFilePlayerProcess
extends java.lang.Object
implements uk.org.toot.audio.core.AudioProcess

A simple (hacky) audio file player process that is NOT sample-accurate. Playing always starts at the beginning of a buffer. Also, files are not played back at their natural sample rate, they are played back at the process sample rate. Glitches may occur.


Nested Class Summary
protected static class AudioFilePlayerProcess.ProcessFormat
           
protected  class AudioFilePlayerProcess.Puller
           
 
Field Summary
protected  javax.sound.sampled.AudioInputStream ais
           
 
Fields inherited from interface uk.org.toot.audio.core.AudioProcess
AUDIO_DISCONNECT, AUDIO_OK
 
Constructor Summary
AudioFilePlayerProcess()
           
 
Method Summary
protected  void attachMetaInfo(uk.org.toot.audio.core.AudioBuffer buffer)
           
 void close()
           
protected  void handleEndOfTrack()
           
 void locate(long microseconds)
           
 void open()
           
protected  void openStream()
           
 int processAudio(uk.org.toot.audio.core.AudioBuffer buffer)
           
 void setFile(java.io.File file, java.lang.String name)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ais

protected javax.sound.sampled.AudioInputStream ais
Constructor Detail

AudioFilePlayerProcess

public AudioFilePlayerProcess()
Method Detail

openStream

protected void openStream()

setFile

public void setFile(java.io.File file,
                    java.lang.String name)

open

public void open()
Specified by:
open in interface uk.org.toot.audio.core.AudioProcess

close

public void close()
Specified by:
close in interface uk.org.toot.audio.core.AudioProcess

attachMetaInfo

protected void attachMetaInfo(uk.org.toot.audio.core.AudioBuffer buffer)

locate

public void locate(long microseconds)

handleEndOfTrack

protected void handleEndOfTrack()

processAudio

public int processAudio(uk.org.toot.audio.core.AudioBuffer buffer)
Specified by:
processAudio in interface uk.org.toot.audio.core.AudioProcess