adding sound to my pong game

hi,
i'm new at programming and have a question about adding sound to my pong game.

This is what i have done for the sound so far but it doesn't work.

(This was added to the GameStart)

m_AudioMusicPtr= new Audio("c:/documenten/bitmaps/Kalimba.mp3");

(this was added to the gameCycle)

m_AudioMusicPtr->Tick();

m_AudioMusicPtr->Play();

I hope you guys could tell me what i am doing wrong or what i forgot.
mariowayAsked:
Who is Participating?
 
George TokasCommented:
You can use DirectSound and DirectSoundBuffer.
There is an implementation from me at:
http://www.gtokas.com/index.php?q=TCDX9en
It is for C++ Builder but can converted for visual studio.
You have to convert from mp3 to wav format though.
Control using:
SoundBuf->Play(bool loop);
SoundBuf->Stop();
No tick needed...

George Tokas.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.