|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectddf.minim.ugens.UGen
ddf.minim.ugens.FilePlayer
public class FilePlayer
The FilePlayer UGen provides a way for you to wrap an AudioRecordingStream with the UGen interface, allowing you to patching into a UGen graph any way you choose. You can get an AudioRecordingStream from Minim by calling Minim.loadFileStream.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class ddf.minim.ugens.UGen |
|---|
UGen.InputType, UGen.UGenInput |
| Constructor Summary | |
|---|---|
FilePlayer(AudioRecordingStream iFileStream)
Construct a FilePlayer that will read from iFileStream. |
|
| Method Summary | |
|---|---|
void |
close()
Calling close will close the AudioStream that this wraps, which is proper cleanup for using the stream. |
void |
cue(int millis)
Sets the position to millis milliseconds from
the beginning. |
AudioMetaData |
getMetaData()
Returns the meta data for the recording being played by this player. |
AudioRecordingStream |
getStream()
Returns the wrapped AudioRecordingStream. |
boolean |
isLooping()
Returns true if this is currently playing and has more than one loop left to play. |
boolean |
isPlaying()
Returns true if this currently playing. |
int |
length()
Returns the length of the sound in milliseconds. |
void |
loop()
Sets looping to continuous. |
void |
loop(int n)
Sets this to loop num times. |
int |
loopCount()
Returns the number of loops left to do. |
void |
pause()
Pauses playback. |
void |
play()
Starts playback from the current position. |
void |
play(int millis)
Starts playback millis from the beginning. |
int |
position()
Returns the current position of the "playhead" (ie how much of the sound has already been played) |
void |
rewind()
Rewinds to the beginning. |
void |
setLoopPoints(int start,
int stop)
Sets the loop points used when looping. |
void |
skip(int millis)
Skips millis from the current position. |
protected void |
uGenerate(float[] channels)
Implement this method when you extend UGen. |
| Methods inherited from class ddf.minim.ugens.UGen |
|---|
addInput, getLastValues, patch, patch, patch, printInputs, removeInput, sampleRate, sampleRateChanged, setSampleRate, tick, unpatch, unpatch |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FilePlayer(AudioRecordingStream iFileStream)
iFileStream - the AudioRecordingStream this should read from| Method Detail |
|---|
public AudioRecordingStream getStream()
public void play()
Playable
play in interface Playablepublic void play(int millis)
Playablemillis from the beginning. If this was previous set to loop,
looping will be disabled.
play in interface Playablepublic void pause()
Playable
pause in interface Playablepublic void rewind()
Playable
rewind in interface Playablepublic void loop()
Playable
loop in interface Playablepublic void loop(int n)
Playablenum times. If this is already playing,
the position will not be reset to the beginning.
If this is not playing, it will start playing.
loop in interface Playablen - the number of times to looppublic int loopCount()
Playable
loopCount in interface Playablepublic int length()
Playable
length in interface Playablepublic int position()
Playable
position in interface Playablepublic void cue(int millis)
Playablemillis milliseconds from
the beginning. This will not change the playstate. If an error
occurs while trying to cue, the position will not change.
If you try to cue to a negative position or try to a position
that is greater than length(), the amount will be clamped
to zero or length().
cue in interface Playablemillis - the position to place the "playhead"public void skip(int millis)
Playablemillis from the current position. millis
can be negative, which will make this skip backwards. If the skip amount
would result in a negative position or a position that is greater than
length(), the new position will be clamped to zero or
length().
skip in interface Playablemillis - how many milliseconds to skip, sign indicates directionpublic boolean isLooping()
Playable
isLooping in interface Playablepublic boolean isPlaying()
Playable
isPlaying in interface Playablepublic AudioMetaData getMetaData()
getMetaData in interface Playable
public void setLoopPoints(int start,
int stop)
Playable
setLoopPoints in interface Playablestart - the start of the loop in millisecondsstop - the end of the loop in millisecondspublic void close()
protected void uGenerate(float[] channels)
UGengetLastValues
method of your audio UGenInput to retrieve the audio you want to modify,
which you will then modify however
you need to, assigning the result to the values in channels.
uGenerate in class UGenchannels - an array representing one sample frame.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||