All Windows OSes should be able to
play .wav files. However,other files
(.mp3,.avi,etc.) might not be
playable if the right codecs or
features aren’t installed on the OS.
文章How to play 24bit WAV files in Windows Media Player中提到的可能修复程序正在修复Windows Media Player的问题,但不适用于autohotkey:
分步指南
>下载Legacy HD Audio Filter
> regsvr32.exe AudioTypeConvert.ax
>在Windows Media Player(作品)和AHK(无声)中播放24bit文件.
> regsvr32.exe / u AudioTypeConvert.ax卸载
预期的行为:Windows Media Player和AutoHotkey应用程序中的音频文件播放没有错误.
实际行为:仅在Windows Media Player中播放音频文件而不会出现错误,并且不会在Windows XP下的AutoHotkey应用程序中播放.
进一步的调查
正如AutoHotKey论坛中提到的,SoundPlay正在使用mciSendString,并且可以通过直接调用更多关于错误性质的信息.
使用mciSendString替代DLL调用我得到error message 320对应于MCIERR_WAVE_OUTPUTSINUSE
All waveform devices that can play files in the current format are in use. Wait until one of these devices is free; then,try again.
我的AutoHotkey应用程序如何在Windows XP中播放24bit音频文件?
基于SoundPlay的测试应用(download)
#NoEnv SetWorkingDir %A_ScriptDir% FileSelectFile,f SoundPlay,%f% MsgBox,You should hear audio - except for 24bit wave files under Windows XP.
基于MCI的测试应用(download)
#NoEnv SetWorkingDir %A_ScriptDir% FileSelectFile,f TryPlaySound(f) MsgBox,You should hear audio - except for 24bit wave files under Windows XP. ; If SoundPlay does not work TryPlaySound TryPlaySound( mFile ) { ; SKAN www.autohotkey.com/forum/viewtopic.PHP?p=361791#361791 VarSetCapacity( DN,16 ),DLLFunc := "winmm.dll\mciSendString" ( A_IsUnicode ? "W" : "A" ) DN := DllCall(DLLFunc,Str,"play " """" mFile """" "",Uint,0) Return DN }