Juce and Stk/rtaudio


Hello all, I’m trying to make an app which marries juce and stk ( https://ccrma.stanford.edu/software/stk/ ) which itself uses rtaudio ( http://www.music.mcgill.ca/~gary/rtaudio/ ). Juce’s built-in audio stuff is great but there are some stk utilities that are very handy for this app. So as a test I’ve created a series of classes which simply play an audio file back using stk. In a simple C++ program the code boils down to:

[code]#include “StkStuff.h”

int main(int argc, char **argv)
RtAudioDriver driver;
for(;:wink: ;

And it works fine, plays the audio file. Now whenever I try to do something similar in a juce app (just using the basic demo app template) there are no errors or crashes, just no sound! I am attempting it by including StkStuff.h (as above) in my maincomponent.h file, then putting RtAudioDriver driver;
in the maincomponent class, in the maincomponent.h file, eg

class MainComponent  : public Component, public DragAndDropContainer
    MainComponent ();
	RtAudioDriver driver;


I’ve tried putting the driver instantiation in public, private, and in the cpp file, but still no output (no errors or crashes, either). I feel like there is something fundamental I am missing, any help is greatly appreciated! I’d be happy to post (lots) more code but I don’t want to inundate everyone, and I’m sort of hoping it’s something basic I’m missing.



It’s a bit hard from that to tell what’s going on. I think a bit of quality time spent with your debugger might be what’s needed…


Hey Jules, the new site looks nice! Unfortunately I normally use makefiles and cerr/cout to debug which isn’t really a possibility with Juce. I suppose it’s time for me to learn Xcode. No ideas as to some basic concept that I’m missing though - am I wrong to think that if I instantiate a class in a program as basic as the one posted, the same thing should happen when I instantiate in another program?



I certainly can’t see anything obviously wrong with what you’re suggesting, though it’s hard to really know what’s going on in that RtAudioThingy class. Maybe it’s just not happy with the fact that it’s a UI app rather than a command-line one.


Right on, I will get debugging. Thanks for the help.