I really want to add sounds to my programs, but all of the codes I use fail!
I am using an empty project in visual c++, if anyone could find a snippet that would work for this, I would be extremely grateful. Thanks!
Here is my current code that doesn't work:
// use mciSendString() to play and stop a midi music file
// you have to link with the winmm.lib file, or
// in the case of Dev-C++ link with libwinmm.a via
// Project>>Project Options>>Parameters>>Add Lib>>libwinmm.a
// a Dev-C++ console application
#include <iostream>
#include <windows.h>
#include <mmsystem.h> // mciSendString()
#include <conio.h>
#include <string>
#include <math.h>
#include <iomanip>
#include <stdlib.h>
using namespace std; // std::cout, std::cin
void Play()
{
wstring file;
wstring Command;
file = L"H:\\sissys.mp3";
Command = L"play " + file + L" from 0";
mciSendString(Command.c_str(), NULL, 0, 0);
}