内部扬声器和可能使用旧的XP的API函数播放声音? [英] Play sound on internal speakers and possibility to use old xp api function?

查看:199
本文介绍了内部扬声器和可能使用旧的XP的API函数播放声音?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

的Windows Vista发布后Windows函数的蜂鸣您连接的扬声器播放提示音,而不是内部之一。

After the release of windows vista the Windows Function Beep plays a beep on your connected speakers instead of the internal one.

反正是有访问旧的功能?是否有可能在一个旧的Windows API让持有?或者有没有其他的办法可以让这一切成为可能?如果是的话我想同时设置频率和持续时间的能力。

Is there anyway to access the old function? Would it be possible by getting hold in an older windows api? Or is there any other way i can make this possible? If so i would like the ability to set both the frequency and duration.

我应该指出,实际上I'm针对Windows XP平台。

I should mention that I´m actually targeting the windows xp platform.

推荐答案

没有。该函数在Kernel32.dll中,这是在运行时加载和您正在运行的操作系统的任何版本实现。由于code是不是有在任何可执行文件或系统DLL,则无法运行(甚至不考虑从不同的操作系统版本复制了Kernel32.dll,它只是尖叫的麻烦)

No. The function is implemented in a Kernel32.dll, which is loaded at runtime from whatever version of the OS you're currently running. Since the code isn't there in either your executable or in a system DLL, you can't run it (don't even think about copying over Kernel32.dll from a different OS version, that's just screaming for trouble).

您可以尝试使用<一个href=\"http://msdn.microsoft.com/en-us/library/windows/desktop/ms680356%28v=vs.85%29.aspx\"><$c$c>MessageBeep而不是蜂鸣,但是,让你少控制输出,并可能会仍然使用你的声卡,而不是内部的

You can try using MessageBeep instead of Beep, but that gives you less control over the output and will probably still use your sound card instead of the internal

对于的MessageBeep 函数的一个有趣的历史,请参阅Larry奥斯特曼的博客

For an interesting history of the MessageBeep function, see Larry Osterman's blog.

这篇关于内部扬声器和可能使用旧的XP的API函数播放声音?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆