播放24bit的音频不可能 [英] Playback 24bit audio not possible

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

问题描述

我尝试播放24位音频文件与我AutoHotkey的应用程序。它只是使用 SoundPlay 。 Windows 7已经没有问题,但是Windows XP用户无法播放24bit的文件。

借助文档说:


  

所有的Windows操作系统应该能够
  播放.wav文件。然而,其他的文件
  (.MP3,.AVI等)可能不
  可玩如果有合适的codeCS或
  功能没有安装操作系统。


文章<一提到可能的修正href=\"http://blogs.msdn.com/b/jongallant/archive/2007/05/23/how-to-play-24-bit-wav-files-in-windows-media-player-media-en$c$cr.aspx?PageIndex=2#comments\">How在正在修复的Windows Media Player问题的Windows Media Player播放24bit的WAV文件,但是而不是AutoHotkey的:

一步一步的指导


  1. HD音频过滤器

  2. regsvr32.exe的AudioTypeConvert.ax

  3. 在Windows媒体播放器(工程)和AHK(无声)播放24bit的文件。

  4. 的regsvr32.exe / U AudioTypeConvert.ax卸载

预期的行为:没有在这两个Windows Media Player和AutoHotkey的应用程序错误的音频文件playsback。
实际的品行:没有错误的音频文件playsback仅在Windows Media Player和AutoHotkey的应用程序在Windows XP下无法播放

进一步调查

正如SoundPlay使用AutoHotkey的论坛中提到 mciSendString 引擎盖上的错误性质的详细信息下,可以通过直接调用它来获得。

使用mciSendString替代DLL调用我得到错误信息320 其对应于<一href=\"http://msdn.microsoft.com/en-us/library/ms713501%28v=vs.85%29.aspx\">MCIERR_WAVE_OUTPUTSINUSE


  

这可以在播放当前格式文件的所有波形设备都在使用中。等到这些设备之一是免费的;然后再试试。


我如何在Windows XP中我AutoHotkey的应用程序播放24位音频文件?

音频采样:结果
24位结果
定期

SoundPlay根据测试应用下载

  #NoEnv
SetWorkingDir%A_ScriptDir%
FileSelectFile,女
SoundPlay,%F%
MSGBOX,你应该听到声音 - 除了在Windows XP 24bit的波形文件。

MCI基础的测试应用下载

  #NoEnv
SetWorkingDir%A_ScriptDir%
FileSelectFile,女
TryPlaySound(F)
MSGBOX,你应该听到声音 - 除了在Windows XP 24bit的波形文件。;如果SoundPlay不起作用TryPlaySound
TryPlaySound(MFILE)
{
    ; SKAN www.autohotkey.com/forum/viewtopic.php?p=361791#361791
    VarSetCapacity(DN 16),DLLFunc:=\\ WINMM.DLL mciSendString(A_IsUni codeW:A)
    DN:= DllCall(DLLFunc,STR,玩MFILE,UINT,0,UINT,0,UINT,0)
    返回DN
}


解决方案

我将在24位文件转换为16位的文件,如果这是在所有可行的。

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.

The documentation says:

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.

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:

Step-by-step guide

  1. Download Legacy HD Audio Filter
  2. regsvr32.exe AudioTypeConvert.ax
  3. Play 24bit file in windows media player (works) and AHK (no sound).
  4. regsvr32.exe /u AudioTypeConvert.ax to uninstall

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.

Further Investigation

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.

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.

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

Audio samples:
24bit
regular

SoundPlay based Test app (download)

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

MCI based test app (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, Uint, 0, Uint, 0)
    Return DN
}

解决方案

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

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

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