I’d like to make a plugin which performs HTTP requests as soon as the host starts or stops recording. I figured out how to make it work inside Cabbage with that rather ugly code snippet shown below but as soon as I export this as an AU-Plugin it does not work inside the DAW.
Do you know another solution to perform HTTP requests inside csound?
Thank you for your help
pyinit
pyruni "import os"
;check if host is currently recording
if changed:k(kIsRecording)==1 then
if kIsRecording == 1 then
pyruni {{data = '{"type":"output","value":true}'}}
else
pyruni {{data = '{"type":"output","value":false}'}}
endif
pyruni {{os.popen("curl -X POST -H 'Content-Type: application/json' http://recordinglight.local:5000/api/gpio/io/12 -d '"+data+"'")}}
endif