Mercurial > hg > piper-vamp-js
diff quick-test.cpp @ 76:56709f8355cb
Use power spectrum rather than zero crossings, to exercise the input domain adapter, and make a process request in quick-test.cpp
author | Chris Cannam <c.cannam@qmul.ac.uk> |
---|---|
date | Tue, 06 Sep 2016 16:08:38 +0100 |
parents | 8db927152497 |
children | 8fdafb8f1c45 |
line wrap: on
line diff
--- a/quick-test.cpp Wed Aug 24 18:00:28 2016 +0100 +++ b/quick-test.cpp Tue Sep 06 16:08:38 2016 +0100 @@ -4,7 +4,7 @@ using namespace std; -int main(int argc, char **argv) +int main(int, char **) { string example = "./example.so"; @@ -35,9 +35,25 @@ cout << listResponse << endl; freeFn(listResponse); - string loadRequest = "{\"type\":\"load\",\"content\": {\"pluginKey\":\"vamp-example-plugins:zerocrossing\",\"inputSampleRate\":44100,\"adapterFlags\":[\"AdaptAllSafe\"]}}"; + string loadRequest = "{\"type\":\"load\",\"content\": {\"pluginKey\":\"vamp-example-plugins:powerspectrum\",\"inputSampleRate\":44100,\"adapterFlags\":[\"AdaptAllSafe\"]}}"; const char *loadResponse = reqFn(loadRequest.c_str()); cout << loadResponse << endl; freeFn(loadResponse); + + string configRequest = "{\"type\":\"configure\",\"content\":{\"pluginHandle\":1,\"configuration\":{\"blockSize\":8,\"channelCount\":1,\"stepSize\":8}}}"; + const char *configResponse = reqFn(configRequest.c_str()); + cout << configResponse << endl; + freeFn(configResponse); + + string processRequest = "{\"type\":\"process\",\"content\":{\"pluginHandle\":1,\"processInput\":{\"timestamp\":{\"s\":0,\"n\":0},\"inputBuffers\":[{\"values\":[0,1,0,-1,0,1,0,-1]}]}}}"; + const char *processResponse = reqFn(processRequest.c_str()); + cout << processResponse << endl; + freeFn(processResponse); + + string finishRequest = "{\"type\":\"finish\",\"content\":{\"pluginHandle\":1}}"; + const char *finishResponse = reqFn(finishRequest.c_str()); + cout << finishResponse << endl; + freeFn(finishResponse); + }