MSDN库中的PlaySound函数 [英] PlaySound function in MSDN library

查看:285
本文介绍了MSDN库中的PlaySound函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在.wav文件上使用PlaySound函数时,它仅播放文件的一部分.例如,它只播放76秒文件的前58秒,只播放三分钟文件的前78秒.这是一个已知问题吗?为什么会这样?

When I use the PlaySound function on a .wav file, it only plays a part of the file. For example, it plays only the first 58 seconds of a 76-second file and only the first 78 seconds of a three-minute file. Is this a known problem? Why does this happen?

我正在使用32位Windows.我在使用Microsoft Visual C ++创建的Win32控制台应用程序中使用了PlaySound函数.我正在尝试使用"PlaySound cuts off"之类的搜索字词在Google上进行搜索,但是没有运气.

I'm using 32-bit Windows. The PlaySound function is used in a Win32 console application that I created using Microsoft Visual C++.  I've trying searching on Google using search terms like "PlaySound cuts off", with no luck.

我经历了其他神秘行为.例如,代码while(condition){}在调试模式下可以正常工作,用于将程序延迟到满足特定条件为止,但在释放模式下不起作用;我必须写while(condition){cout<"};}. 这也是一个已知问题吗?

I've experienced other mysterious behavior.  For example, the code while(condition) {} works fine in debug mode for delaying the program until a certain condition is satisfied, but does not work in release mode; I had to write while(condition) {cout<<"";}.  Is this also a known problem?

预先感谢.

推荐答案

对于第二期, http://www.drdobbs.com/184403766 .

For the second issue,  if ‘condition’ checks variables modified by different threads, then try adding ‘volatile’ in declarations. See http://www.drdobbs.com/184403766.


这篇关于MSDN库中的PlaySound函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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