• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 704
  • Last Modified:

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.
0
marioway
Asked:
marioway
1 Solution
 
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

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now