windows-xp – 无法播放24bit音频

我试图用我的AutoHotkey应用程序播放一个24bit音频文件.它只是使用 SoundPlay. Windows 7没有问题,但Windows XP用户无法播放24bit文件.

documentation说:

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
}
我会将24位文件转换为16位文件,如果这一切都是可行的.

相关文章

Windows2012R2备用域控搭建 前置操作 域控主域控的主dns:自...
主域控角色迁移和夺取(转载) 转载自:http://yupeizhi.blo...
Windows2012R2 NTP时间同步 Windows2012R2里没有了internet时...
Windows注册表操作基础代码 Windows下对注册表进行操作使用的...
黑客常用WinAPI函数整理之前的博客写了很多关于Windows编程的...
一个简单的Windows Socket可复用框架说起网络编程,无非是建...