|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectbe.hogent.tarsos.sampled.Player
public class Player
Player plays audio. When the state of the audio player changes a property change is fired on the 'state' property. The player allows time stretching and volume change. Adding AudioProcessor objects before the time stretching step can implement any audio processing step.
| Method Summary | |
|---|---|
void |
addProcessorBeforeTimeStrechting(be.hogent.tarsos.dsp.AudioProcessor processor)
Adds an audio processor to the chain before time stretching kicks in. |
void |
addPropertyChangeListener(java.beans.PropertyChangeListener l)
Adds a change listener. |
void |
eject()
Ejects the currently loaded file. |
double |
getCurrentTime()
|
double |
getDurationInSeconds()
If no file is loaded a illegal state exception is fired. |
static Player |
getInstance()
|
double |
getStartAt()
|
PlayerState |
getState()
|
double |
getStopAt()
Returns the time at which the audio play back stops automatically. |
void |
increaseGain(double percent)
Increase the gain by a defined percentage. |
void |
increaseTempo(double percent)
Increase the tempo by a defined percentage. |
void |
load(java.io.File file)
Loads a new audio file. |
void |
pauze()
Stops the play back at current time. |
void |
pauze(double pauzeAt)
Stops the play back. |
void |
play()
Plays the currently loaded file. |
void |
play(double startTime)
|
boolean |
process(be.hogent.tarsos.dsp.AudioEvent audioEvent)
|
void |
processingFinished()
|
boolean |
removeProcessorBeforeTimeStretching(be.hogent.tarsos.dsp.AudioProcessor processor)
Removes an audio processor to the chain before time stretching kicks in. |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener l)
Removes a change listener. |
void |
setGain(double newGain)
Set the gain for the current stream. |
void |
setStopAt(double stopAt)
At this point the sound that is played stops automatically. |
void |
setTempo(double newTempo)
Set the tempo for the current stream. |
void |
stop()
Stops the play back. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public void setStopAt(double stopAt)
stopAt - The time at which the player stops (in seconds).public double getStopAt()
public void load(java.io.File file)
file - The audio file to load.public void eject()
public void play()
public void play(double startTime)
public void pauze()
public void pauze(double pauzeAt)
pauzeAt - The time at which to resume playing after calling play (in
seconds).public void stop()
public void setGain(double newGain)
newGain - The gain to apply to the current stream, 1 is no change, 0.8
is 80% of the volume and 2 double (watch out for clipping when
using values > 1)public void setTempo(double newTempo)
newTempo - The new tempo for the current stream. 1 is no change, 2 is double tempo, 0.5 half.public double getDurationInSeconds()
public PlayerState getState()
public double getStartAt()
public double getCurrentTime()
public void addProcessorBeforeTimeStrechting(be.hogent.tarsos.dsp.AudioProcessor processor)
processor - the processor to add.public boolean removeProcessorBeforeTimeStretching(be.hogent.tarsos.dsp.AudioProcessor processor)
processor - the processor to remove.
public void addPropertyChangeListener(java.beans.PropertyChangeListener l)
l - The listener to add.public void removePropertyChangeListener(java.beans.PropertyChangeListener l)
l - The listener to remove.public boolean process(be.hogent.tarsos.dsp.AudioEvent audioEvent)
process in interface be.hogent.tarsos.dsp.AudioProcessorpublic void processingFinished()
processingFinished in interface be.hogent.tarsos.dsp.AudioProcessorpublic static Player getInstance()
public void increaseGain(double percent)
percent - To increase the gain.public void increaseTempo(double percent)
percent - To increase the tempo.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||