469,889 Members | 1,258 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,889 developers. It's quick & easy.

PlaySound funtion

Chaps and Chapettes,

Program in C++.

Im doing a project to detect a defined marker, then play the relevent
sound when it can no longer be seen.
It worked well when using the beep function.

if( config->//not visivle ) Beep(176,20);

But when I run with the code below it either plays the error tone
which suggests it can't find the file (even though its in the local
directiory) or it crashes.
if( config-//not visivble ) PlaySound('test' , NULL, SND_FILENAME |
SND_ASYNC);

Any suggestions as to where my mistake is?

Thanks for your time.

Jan 30 '07 #1
4 1959
Cogito wrote:
Chaps and Chapettes,

Program in C++.

Im doing a project to detect a defined marker, then play the relevent
sound when it can no longer be seen.
It worked well when using the beep function.

if( config->//not visivle ) Beep(176,20);

But when I run with the code below it either plays the error tone
which suggests it can't find the file (even though its in the local
directiory) or it crashes.
if( config-//not visivble ) PlaySound('test' , NULL, SND_FILENAME |
SND_ASYNC);

Any suggestions as to where my mistake is?

Thanks for your time.
>Any suggestions as to where my mistake is?
Asking this question on comp.lang.c perhaps?

Try a group that knows something about the OS you're using.

Jan 30 '07 #2
Cogito wrote:
Chaps and Chapettes,

Program in C++.
newsgroup in comp.lang.c++.
Im doing a project to detect a defined marker, then play the relevent
sound when it can no longer be seen.
It worked well when using the beep function.

if( config->//not visivle ) Beep(176,20);
Isn't that a syntax error even in C++?
But when I run with the code below it either plays the error tone
which suggests it can't find the file (even though its in the local
directiory) or it crashes.
if( config-//not visivble ) PlaySound('test' , NULL, SND_FILENAME |
SND_ASYNC);
`PlaySound` isn't a Standard C function. I suspect you need a newsgroup
in which that library is topical.

As a random suggestion, try giving the filename argument a /complete/
filename, including the directory path and any suffix if there's supposed
to be one. (Maybe your directory browser is helpfully suppressing a
..snd suffix, or something like that.)

--
Chris "electric hedgehog" Dollin
"Reaching out for mirrors hidden in the web." - Renaissance, /Running Hard/

Jan 30 '07 #3
Cogito <se*********@gmail.comwrote:
Program in C++.
This is comp.lang.c; comp.lang.c++ is that way -(but you're still
mostly off-topic there as well).
if( config->//not visivle ) Beep(176,20);
It's "visible", which I feel the need to point out since you failed to
spell it correctly in two separate ways in your post. Cut-and-paste
is your friend.
if( config-//not visivble ) PlaySound('test' , NULL, SND_FILENAME |
SND_ASYNC);
Any suggestions as to where my mistake is?
Maybe you meant

if( config-//not visivble ) PlaySound("test" , NULL, SND_FILENAME |

Those double quotes are probably important. If that's not your
problem you'll definitely want to consider

http://www.ungerhu.com/jxh/clc.welcome.txt
http://c-faq.com
http://benpfaff.org/writings/clc/off-topic.html

before posting here again.

--
C. Benson Manica | I *should* know what I'm talking about - if I
cbmanica(at)gmail.com | don't, I need to know. Flames welcome.
Jan 30 '07 #4
pemo wrote:
Cogito wrote:
>>
Program in C++.

Im doing a project to detect a defined marker, then play the
relevent sound when it can no longer be seen.
It worked well when using the beep function.

if( config->//not visivle ) Beep(176,20);

But when I run with the code below it either plays the error
tone which suggests it can't find the file (even though its in
the local directiory) or it crashes.
if( config-//not visivble ) PlaySound('test' , NULL, SND_FILENAME |
SND_ASYNC);

Any suggestions as to where my mistake is?

Asking this question on comp.lang.c perhaps?

Try a group that knows something about the OS you're using.
Besides which, in C++, the statement:

if (config->
SND_ASYNC);

and in C the statement portion

if (config-//not

is either a syntax error (C90) or the same as the above (C99).
"/not" is not a valid identifier.

doesn't seem to do much.

--
<http://www.cs.auckland.ac.nz/~pgut001/pubs/vista_cost.txt>

"A man who is right every time is not likely to do very much."
-- Francis Crick, co-discover of DNA
"There is nothing more amazing than stupidity in action."
-- Thomas Matthews
Jan 30 '07 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

19 posts views Thread by bballmitch | last post: by
3 posts views Thread by Harry J. Smith | last post: by
4 posts views Thread by rcattral | last post: by
2 posts views Thread by Joe Thompson | last post: by
10 posts views Thread by Ot | last post: by
9 posts views Thread by Andy | last post: by
reply views Thread by Salome Sato | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.