public 驱动器上的 wav 声音不同
wav sound is different on a public drive
我有一个播放 wav 文件的宏。声音是"click",循环播放5次。下面是用于播放 wav 文件的代码行:
sndPlaySound32 "C:\Temp\Click2.wav", SND_SYNC
sndPlaySound32 "W:\Users\Game\Click2.wav", SND_SYNC
当 wav 文件存储在我的硬盘上时,它听起来像我希望听到的 "click"。当存储在public"W"驱动器上时,是Windows"ding".
为什么文件在不同的驱动器上时听起来不一样?是否有我可以更改的设置以避免 Windows "ding".
感谢帮助.....
检查您的文件名和文件路径,我猜是找不到文件,您听到的是默认文件。来自 documentation:
If the specified sound cannot be found, sndPlaySound plays the system
default sound. If there is no system default entry in the registry or
WIN.INI file, or if the default sound cannot be found, the function
makes no sound and returns FALSE.
如果您想禁用此行为,请传递 SND_NODEFAULT
标志:
sndPlaySound32 "C:\Temp\Click2.wav", (SND_SYNC Or SND_NODEFAULT)
我有一个播放 wav 文件的宏。声音是"click",循环播放5次。下面是用于播放 wav 文件的代码行:
sndPlaySound32 "C:\Temp\Click2.wav", SND_SYNC
sndPlaySound32 "W:\Users\Game\Click2.wav", SND_SYNC
当 wav 文件存储在我的硬盘上时,它听起来像我希望听到的 "click"。当存储在public"W"驱动器上时,是Windows"ding".
为什么文件在不同的驱动器上时听起来不一样?是否有我可以更改的设置以避免 Windows "ding".
感谢帮助.....
检查您的文件名和文件路径,我猜是找不到文件,您听到的是默认文件。来自 documentation:
If the specified sound cannot be found, sndPlaySound plays the system default sound. If there is no system default entry in the registry or WIN.INI file, or if the default sound cannot be found, the function makes no sound and returns FALSE.
如果您想禁用此行为,请传递 SND_NODEFAULT
标志:
sndPlaySound32 "C:\Temp\Click2.wav", (SND_SYNC Or SND_NODEFAULT)