summaryrefslogtreecommitdiff
path: root/03_play/src/testApp.cpp
diff options
context:
space:
mode:
authorTim <tim@Admins-Mac-Pro-2.local>2013-06-14 18:19:11 +0100
committerTim <tim@Admins-Mac-Pro-2.local>2013-06-14 18:19:11 +0100
commit577e61af4e08eb4b9f68f27343802f65a8fcddb0 (patch)
treed04896c98db7595e56e7ff2944193ca30a6b145c /03_play/src/testApp.cpp
parentc00137b70ac965a928b56a7a31e655de29608284 (diff)
making audio sync
Diffstat (limited to '03_play/src/testApp.cpp')
-rw-r--r--03_play/src/testApp.cpp19
1 files changed, 12 insertions, 7 deletions
diff --git a/03_play/src/testApp.cpp b/03_play/src/testApp.cpp
index 3670a8b..e990ea8 100644
--- a/03_play/src/testApp.cpp
+++ b/03_play/src/testApp.cpp
@@ -19,9 +19,10 @@ void testApp::setup() {
int num=XML.getNumTags("rec");
if(num) {
for (int i=0;i<num;i++) {
- vector<string> rec;
- rec.push_back(XML.getAttribute("rec","left","",i));
- rec.push_back(XML.getAttribute("rec","right","",i));
+ record rec;
+ rec.data.push_back(XML.getAttribute("rec","left","",i));
+ rec.data.push_back(XML.getAttribute("rec","right","",i));
+ rec.audio=XML.getAttribute("rec","audio","",i);
recs.push_back(rec);
}
}
@@ -35,10 +36,10 @@ void testApp::setup() {
openNIPlayers[deviceID].start();
//openNIPlayers[deviceID].startPlayer(ofToDataPath(recs[playing][deviceID]));
}
- soundplayer.loadSound("02.wav");
+ soundplayer.setLoop(false);
startPlayers();
- ofSetFrameRate(25.0f);
+ //ofSetFrameRate(25.0f);
}
void testApp::startPlayers(){
@@ -46,10 +47,14 @@ void testApp::startPlayers(){
//openNIPlayers[deviceID].stop();
//openNIPlayers[deviceID].setup(false);
//openNIPlayers[deviceID].start();
- openNIPlayers[deviceID].startPlayer(ofToDataPath(recs[playing][deviceID]));
+ openNIPlayers[deviceID].startPlayer(ofToDataPath(recs[playing].data[deviceID]));
+ soundplayer.stop();
soundplayer.setPosition(0.0f);
- soundplayer.play();
+ if (recs[playing].audio!=""){
+ soundplayer.loadSound(recs[playing].audio);
+ soundplayer.play();
+ }
}
}