-1

1 - I just want to simply play a .wav audio file in c++ program. I do NOT want make complex things with audio file...like recording or something else...just play it. Is it possible without using specifics audio libraries?? For example, Windows.h.Does it work with simple function or not??

2 - Is it possible to play audio files in console?

Mike Kinghan
  • 55,740
  • 12
  • 153
  • 182
  • http://stackoverflow.com/questions/1565439/how-to-playsound-in-c-using-windows-api – marcinj Jan 26 '14 at 10:04
  • Why the downvotes? I think this is a legit question; especially if he is new to programming he will have problems using documentations and references – Sebastian Hoffmann Jan 26 '14 at 10:12
  • Thanks Paranaix. Moreover the link's solutions do not work...but may it is my problem: in some of that answers they say that i need link the winmm.lib library in my project settings, but where?? In which section of project setting?? And what should I write to link the library?? – FlamNight Jan 26 '14 at 11:45
  • I use Visual Studio 2010. Thank you. – FlamNight Jan 26 '14 at 11:51

1 Answers1

1

You can use PlaySound to play a voice file as:

PlaySound(pathToFile, NULL, SND_FILENAME);
BigBoss
  • 6,904
  • 2
  • 23
  • 38
  • This does not works. Already tried...Can you please show me a full expamle program plz? Not just prototype of function... – FlamNight Jan 26 '14 at 11:47