This page is brought to you by NCH Swift Sound who provide the following:
Obtaining Voice Overs for Windows Applications
When retaining your voice over artist, you should ensure that you have the voice over recorded in an the microsoft "wav" audio file format. As a guide to using the World-Voices Online Voice Over Artist Index please see: Guide to World-Voices.
C++ Windows Sound Programming
Voice prompts must be recorded in the microsoft "wav" file format (at least the header) for effective use with Windows applications.
PlaySound Command
Short voice prompts (less than 1MB as a guide) can be played using the PlaySound command as follows:
PlaySound("myfile.wav",NULL,SND_ASYNC|SND_FILENAME);
Where "myfile.wav" is the name of the file you wish to play. The function returns true is the sound starts playing.
MCI Playback
For longer file playback, you will need to use the MCI. An example follows:
mciSendString(
"open myfile.wav type waveaudio alias myfile",
lpszReturnString, lstrlen(lpszReturnString), NULL);
mciSendString("play myfile", lpszReturnString,
lstrlen(lpszReturnString), NULL);
mciSendString("close myfile", lpszReturnString,
lstrlen(lpszReturnString), NULL);
More Information