Adding audio to game with SimpleAudioEngine

I’m trying to add sound effects and music into my game by following the programmer’s guide here.

However, it does not work saying 'SimpleAudioEngine' has not been declared when using auto audio = SimpleAudioEngine::getInstance();

I found this article and says to do auto audio = CocosDenshion::SimpleAudioEngine::getInstance(); and it works.

Now I need to create a global variable for audio in my .h file but I can’t figure out what the object type is. I have tried CocosDenshion* audio, CocosDension audio, SimpleAudioEngine* audio and SimpleAudioEngine audio but none of them work.

Any help would be appreciated.
Thanks

Did you include .h?

I used #include "SimpleAudioEngine.h"

 #include "SimpleAudioEngine.h"
using namespace CocosDenshion

then:

SimpleAudioEngine::getInstance()->playEffect(“sfx.mp3”)

Thank you @sevent7 for the answer.
However, @slackmoehrle, shouldn’t CocosDenshion be mentioned in the programmer’s guide as it was bit confusing for someone new like me.

absolutely. I will add this to our new docs, coming out soon. Thanks for pointing it out.

PR here: https://github.com/cocos2d/cocos2d-x-docs/pull/29