无法播放 24 位音频 [英] Playback 24bit audio not possible

查看:34
本文介绍了无法播放 24 位音频的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用我的 AutoHotkey 应用程序播放 24 位音频文件.它只使用 SoundPlay.Windows 7 没有问题,但 Windows XP 用户无法播放 24 位文件.

I'm trying to play a 24bit audio file with my AutoHotkey app. It just uses SoundPlay. Windows 7 has no problem, however Windows XP users cannot play the 24bit files.

文档 说:

所有 Windows 操作系统都应该能够播放 .wav 文件.但是,其他文件(.mp3、.avi 等)可能不是如果正确的编解码器或操作系统上未安装功能.

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.

文章中提到的可能修复如何在 Windows Media Player 中播放 24 位 WAV 文件 正在解决 Windows Media Player 的问题,但是,但不适用于自动热键:

Possible fixes mentioned in the article How to play 24bit WAV files in Windows Media Player are fixing the problem for Windows Media Player, however but not for autohotkey:

分步指南

  1. 下载传统高清音频过滤器
  2. regsvr32.exe AudioTypeConvert.ax
  3. 在 windows 媒体播放器(有效)和 AHK(无声音)中播放 24 位文件.
  4. regsvr32.exe/u AudioTypeConvert.ax 卸载

预期行为:在 Windows Media Player 和 AutoHotkey 应用程序中播放音频文件时没有错误.实际行为:音频文件仅在 Windows Media Player 中无错误播放,在 Windows XP 下的 AutoHotkey Apps 中无法播放.

Expected behaviour: audio file playsback without errors in both Windows Media Player and AutoHotkey Apps. Actual behavious: audio file playsback without errors only in Windows Media Player and does not playback in AutoHotkey Apps under Windows XP.

进一步调查

正如 AutoHotKey 论坛中提到的,SoundPlay 正在使用 mciSendString 在幕后,可以通过直接调用它来获得有关错误性质的更多信息.

As mentioned in the AutoHotKey forums SoundPlay is using mciSendString under the hood and more information on the nature of the error can be gained by calling it directly.

使用 mciSendString 替代 DLL 调用我得到 错误消息 320 对应于 MCIERR_WAVE_OUTPUTSINUSE

Using the mciSendString alternative DLL call I get error message 320 which corresponds to 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 中播放 24 位音频文件?

How do I play 24bit audio files in Windows XP in my AutoHotkey app?

基于 SoundPlay 的测试应用(下载)

#NoEnv 
SetWorkingDir %A_ScriptDir%
FileSelectFile, f
SoundPlay, %f%
Msgbox, You should hear audio - except for 24bit wave files under Windows XP.

基于 MCI 的测试应用(下载)

#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, Uint, 0, Uint, 0)
    Return DN
}

推荐答案

如果可行的话,我会将 24 位文件转换为 16 位文件.

I would convert the 24-bit file to a 16-bit file, if that's at all feasible.

这篇关于无法播放 24 位音频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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