加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Windows > 正文

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

发布时间:2020-12-14 04:32:38 所属栏目:Windows 来源:网络整理
导读:我试图用我的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
我试图用我的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.dllmciSendString" ( A_IsUnicode ? "W" : "A" )
    DN := DllCall(DLLFunc,Str,"play " """" mFile """" "",Uint,0)
    Return DN
}
我会将24位文件转换为16位文件,如果这一切都是可行的.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读