PlaySound()

I'm doing a project that requires the user to type in the phonetic sounds.

For example, th. Then the program will play a wave file that produce th sound. As there are many different wave files for a phonetic sounds, I have decided to group them into separate files, which means it would not be in the same folder of the .exe directory. In this case how do I play the sound that is from another file?

Here is the segment that I thought could work but it didnt.. Please help me!

FILENAME1 = strcat(text_data, ".wav");
FILENAME2 = strcat("consonants\\", FILENAME1);
printf ("%s", FILENAME2);
PlaySound(TEXT(FILENAME2), NULL, SND_SYNC);

The text_data contains what the user types.such as "th". and the applicaiton plays the th.wav file Is it possible to play it from another folder? So that I can group various wav files into categories.

Then it will be something like this:;

Debug (contains the .exe file) --> consonants --> th.wav (this is the one I want to play but it will not be in the same directory as the .exe file.

Please help me. Thanks a lot!
Give the location as part of the FILENAME2, such that by the time you're finished, FILENAME2 is
C:/directoryone/directory2/consonants/nameOfFile.wav, for example.

Note that you can use / instead of \\.
Topic archived. No new replies allowed.