Skip to content

Instantly share code, notes, and snippets.

@yorung
Last active December 12, 2015 07:01
Show Gist options
  • Select an option

  • Save yorung/3c34e13a4b601ef41a26 to your computer and use it in GitHub Desktop.

Select an option

Save yorung/3c34e13a4b601ef41a26 to your computer and use it in GitHub Desktop.
class SL {
SLObjectItf engineObject = nullptr;
SLEngineItf engineEngine = nullptr;
SLObjectItf outputMixObject = nullptr;
public:
SL() {
SLHandleError(slCreateEngine(&engineObject, 0, nullptr, 0, nullptr, nullptr));
SLCall(engineObject, Realize, SL_BOOLEAN_FALSE);
SLCall(engineObject, GetInterface, SL_IID_ENGINE, &engineEngine);
SLInterfaceID ids = SL_IID_ENVIRONMENTALREVERB;
SLboolean req = SL_BOOLEAN_FALSE;
SLCall(engineEngine, CreateOutputMix, &outputMixObject, 1, &ids, &req);
SLCall(outputMixObject, Realize, SL_BOOLEAN_FALSE);
}
~SL() {
SafeDestroy(outputMixObject);
SafeDestroy(engineObject);
engineEngine = nullptr;
}
SLEngineItf GetEngine(){ return engineEngine; }
SLObjectItf GetOutputMixObject() { return outputMixObject; }
};
static SL sl;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment