0

I am working on a console application where i have to deal with multiple sound file with all of same type(.wav or .mp3). I have the option to chose between the two.

I can play the sound fine using PlaySound() function but i need some extra features.

I need pausing the sound and then play from the position where it paused last time.

OR

Set a time from where playing should start and time for which it should play.

1 of the two options will do the job.

I am working on windows with DEV C++ compiler.

Any help and ideas?

mtvec
  • 17,846
  • 5
  • 52
  • 83
Hardeep Brah
  • 17
  • 2
  • 8
  • Try `mciSendString`, though it might be a bit hard to work out if it's your first time using it: http://msdn.microsoft.com/en-us/library/windows/desktop/dd757161(v=vs.85).aspx – chris Apr 24 '12 at 13:52
  • Dev-C++ is unmaintained, and comes with an ancient version of GCC. For a similar environment, try [Code::Blocks](http://www.codeblocks.org/). – Jon Purdy Apr 24 '12 at 15:00
  • So what is the actual question? To choose between MP3 and WAV or to choose how to keep the start and end playing times? – Artak Begnazaryan Apr 24 '12 at 15:03
  • how to keep the start and end playing times? – Hardeep Brah Apr 24 '12 at 16:55

1 Answers1

0

Use the Windows Media Player activeX control for anything more sophistcated than straight playing of a WAV file. It is far easier.

See "Using the Windows Media Player Control in a C++ Program" on MSDN:

http://msdn.microsoft.com/en-us/library/windows/desktop/dd564580(v=vs.85).aspx

Ben
  • 34,935
  • 6
  • 74
  • 113