Click to See Complete Forum and Search --> : Playing *.Wav Files


GreenGiant
April 28th, 1999, 04:08 PM
How do you play a wav file?
source code wise i mean

Of all the things I've lost I miss my mind the most

Gomez Addams
April 28th, 1999, 05:00 PM
Have a look in the multimedia section of this site.
There should be something there to help you get started.

Funkmaster P
April 28th, 1999, 06:15 PM
You can play a wave file using the PlaySound function
e.g.
PlaySound("fmast.wav", NULL, SND_FILENAME | SND_ASYNC);

with, obviously, your file in place of fmast.wav

FUNKMASTER P

GreenGiant
April 28th, 1999, 06:21 PM
can this function play wav's directly from the hardrive or does the wav have to be in the project's workspace?

Of all the things I've lost I miss my mind the most

GreenGiant
April 28th, 1999, 06:22 PM
when i try to use this function it says:

error LNK2001: unresolved external symbol __imp__PlaySoundA@12




how do i fix this? im including mmsystem.h in my dialog's cpp file

Of all the things I've lost I miss my mind the most

Funkmaster P
April 28th, 1999, 06:25 PM
If you specify the absolute path i.e. (C:msdevstd/bin/fmast.wav) then your file can be anywhere on the hard drive, however if you use the path (or lack there of :)) that i included in the snippet, I believe the files has to be in the same directory as the code

FUNKMASTER P

Funkmaster P
April 28th, 1999, 06:27 PM
oh yeah sorry forgot...
this is a pretty old function not MFC you know
trying including windows.s
i.e.
#include windows.h

FUNKMASTER P

GreenGiant
April 28th, 1999, 10:12 PM
nope including windows.h doesnt help, still has the same linking error, any other ideas?

Of all the things I've lost I miss my mind the most

Rich Peters
April 30th, 1999, 02:20 AM
link with winmm.lib

Troy T
April 30th, 1999, 02:27 AM
Do everything that you have been (using the PlaySound() function), and linking to the .lib file that was given, but include the following line of code at the top of your .cpp file that you're calling the PlaySound() function in..

#include "mmsystem.h"



Have fun!


- Troy