Second example with audio playing along-side track. FOUND A BUG!!! The audio file is not resampled by the .rate() method, so image is ORIGINAL RATE / NEW RATE times longer than expected. Ahhhhhh.
This commit is contained in:
parent
74f12083bb
commit
5fb2fe7990
|
@ -0,0 +1,25 @@
|
||||||
|
import processing.sound.*;
|
||||||
|
import soundtrack.optical.*;
|
||||||
|
|
||||||
|
SoundtrackOptical soundtrack;
|
||||||
|
SoundFile playback; //to be used to play audio
|
||||||
|
|
||||||
|
String soundtrackFile = "../../data/barking.wav";
|
||||||
|
int dpi = 2400;
|
||||||
|
float volume = 1.0;
|
||||||
|
String type = "dual variable area";
|
||||||
|
String pitch = "long";
|
||||||
|
boolean positive = true;
|
||||||
|
|
||||||
|
void setup() {
|
||||||
|
size(213, 620);
|
||||||
|
frameRate(24);
|
||||||
|
soundtrack = new SoundtrackOptical(this, soundtrackFile, dpi, volume, type, pitch, positive);
|
||||||
|
playback = new SoundFile(this, soundtrackFile);
|
||||||
|
|
||||||
|
playback.play();
|
||||||
|
}
|
||||||
|
|
||||||
|
void draw () {
|
||||||
|
soundtrack.frame(0, 0);
|
||||||
|
}
|
Loading…
Reference in New Issue