Playsound功能 [英] Playsound Function
问题描述
为什么以下代码不起作用?
char soundfile2 [] =" C:/ Windows / Media / pinky和
brain.wav" ;;
PlaySound(soundfile2,NULL,SND_FILENAME | SND_SYNC | SN D_ASYNC);
getchar();
>
i将libwinmm.a放在参数中,我有所有正确的headerfiles
,但它不会工作。它说我必须声明SND_FILENAME,
SND_SYNC以及第二行中的所有其他内容。它在控制台应用程序中完美地运行,但它似乎无法在过量的应用程序中运行。顺便说一句,我使用命名空间std。
有人可以帮帮我。
Why won''t the following code work?
char soundfile2[] = "C:/Windows/Media/pinky and the
brain.wav";
PlaySound(soundfile2,NULL,SND_FILENAME|SND_SYNC|SN D_ASYNC);
getchar();
i put libwinmm.a in the parameters and i have all the right headerfiles
in there, but it won''t work. it says that i must declare SND_FILENAME ,
SND_SYNC and everything else in the second line. It works perfectly in
a console application but it doesn''t seem to work in a glut
application. BTW, im using namespace std.
can someone please help me out.
推荐答案
bballmitch写道:
bballmitch wrote:
为什么以下代码不起作用?
char soundfile2 [] =" C:/ Windows / Media / pinky和
brain.wav" ;;
PlaySound(soundfile2,NULL,SND_FILENAME | SND_SYNC | SN D_ASYNC);
getchar();
[...]
Why won''t the following code work?
char soundfile2[] = "C:/Windows/Media/pinky and the
brain.wav";
PlaySound(soundfile2,NULL,SND_FILENAME|SND_SYNC|SN D_ASYNC);
getchar();
[...]
标准C ++中没有''PlaySound''功能,顺便说一句
这个新闻组的唯一主题。如果它支持播放声音,请为你的
平台尝试新闻组。
另外,作为附注,Windows中的目录名称分隔符不是
''/''符号,但''\''符号,当
放入字符串文字时,也需要加倍。您可能想尝试
char soundfile2 [] =" C:\\ Windows \\ Media \\pinky和brain.wav" ;;
V
There is no ''PlaySound'' function in Standard C++, which is incidentally
the only subject of this newsgroup. Please try a newsgroup for your
platform if it supports playing sound.
Also, as a side note, the directory name separator in Windows is not
the ''/'' symbol but the ''\'' symbol, which also needs to be doubled when
put in a string literal. You might want to try
char soundfile2[] = "C:\\Windows\\Media\\pinky and the brain.wav";
V
你想打赌那里没有playound功能?我知道有一个事实
是因为我用过它。但它不能在OpenGL文件中工作,只需要
控制台应用程序。我需要帮助,所以不要谈论你不知道的事情。这三行完全适用于Dev C ++控制台应用程序。
you want to bet there''s no playsound function? i know for a fact there
is cause i''ve used it. but it won''t work in an OpenGL file, only
console application. i need help, so don''t talk about what you don''t
know. those three lines EXACTLY work in Dev C++ console application.
* bballmitch:
* bballmitch:
你想打赌那里没有playound功能?我知道有一个事实
是因为我使用过它。但它不能用于OpenGL文件,只能用于控制台应用程序。我需要帮助,所以不要谈论你不知道的事情。这三行完全适用于Dev C ++控制台应用程序。
you want to bet there''s no playsound function? i know for a fact there
is cause i''ve used it. but it won''t work in an OpenGL file, only
console application. i need help, so don''t talk about what you don''t
know. those three lines EXACTLY work in Dev C++ console application.
我们都知道它是9月。
- -
答:因为它弄乱了人们通常阅读文字的顺序。
问:为什么这么糟糕?
答:热门发布。
问:usenet和电子邮件中最烦人的是什么?
As we all know it''s september.
--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
这篇关于Playsound功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!