|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.xuggle.mediatool.demos.MovingBalls
public class MovingBalls
An implementation of Balls
that moves the balls
around in a rectangle, and plays a sound for each
ball that changes when it hits a wall.
Constructor Summary | |
---|---|
MovingBalls(int ballCount,
int width,
int height,
int sampleCount)
Grow a set of balls. |
Method Summary | |
---|---|
static double |
addSignal(int frequency,
int sampleRate,
double volume,
double progress,
short[] samples)
Add a signal of a given frequency to a set of audio samples. |
short[] |
getAudioFrame(int sampleRate)
Get the next set of audio for the balls. |
BufferedImage |
getVideoFrame(long elapsedTime)
Get a picture of a set of balls. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MovingBalls(int ballCount, int width, int height, int sampleCount)
Method Detail |
---|
public BufferedImage getVideoFrame(long elapsedTime)
Balls
getVideoFrame
in interface Balls
elapsedTime
- the time in MICROSECONDS which has elapsed since the
last video framepublic short[] getAudioFrame(int sampleRate)
Balls
getAudioFrame
in interface Balls
sampleRate
- the number of samples in a secondpublic static double addSignal(int frequency, int sampleRate, double volume, double progress, short[] samples)
frequency
- the frequency of the signal to addsampleRate
- the number samples in a secondvolume
- the amplitude of the signalprogress
- the start position the signal, initally should be
zero, it will be updated by addSignal and returned, pass the
returned value into subsquent calls to addSignalsamples
- the array to which the samples will be added
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |