mirror of
https://github.com/processing/processing4.git
synced 2026-02-03 05:39:18 +01:00
27 lines
545 B
Plaintext
27 lines
545 B
Plaintext
/**
|
|
* Audio.
|
|
* Audio playback using the GSPlayer object.
|
|
* By Ryan Kelln
|
|
*
|
|
* Move the cursor across the screen to change volume.
|
|
*/
|
|
|
|
import codeanticode.gsvideo.*;
|
|
|
|
GSPlayer sample;
|
|
|
|
void setup() {
|
|
size(100, 100);
|
|
// The last parameter is used to indicate the stream type:
|
|
// VIDEO (default), AUDIO or DATA.
|
|
sample = new GSPlayer(this, "groove.mp3", GSVideo.AUDIO);
|
|
sample.loop();
|
|
}
|
|
|
|
void draw()
|
|
{
|
|
//sample.jump(float(mouseY) / height * sample.duration());
|
|
|
|
sample.volume(float(mouseX) / width);
|
|
}
|