Skip to content

Instantly share code, notes, and snippets.

@kashimAstro kashimAstro/ofLogAudio.h
Last active Jan 23, 2018

Embed
What would you like to do?
simple script audio synth for openframeworks
class ofLogAudio : public ofThread{
public:
bool startSpeak = false;
string msg;
string speak;
void start(string _c="/usr/bin/espeak -v mb-it3")
{
speak = _c;
startThread(true);
}
void LogAudio(string _msg)
{
msg = _msg;
startSpeak = true;
}
void threadedFunction()
{
while(isThreadRunning())
{
if(startSpeak)
{
ofSystem(speak+" '"+msg+"' > /dev/null 2>&1");
startSpeak = false;
}
}
}
};
class ofApp: public ofBaseApp{
public:
ofLogAudio log;
void setup(){
log.start("/usr/bin/espeak");
log.LogAudio("Hello World");
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.