Note that there are some explanatory texts on larger screens.

plurals
  1. POPlayback 24bit audio not possible
    text
    copied!<p>I'm trying to play a 24bit audio file with my AutoHotkey app. It just uses <a href="http://www.autohotkey.com/docs/commands/SoundPlay.htm" rel="nofollow noreferrer">SoundPlay</a>. Windows 7 has no problem, however Windows XP users cannot play the 24bit files. </p> <p>The <a href="http://www.autohotkey.com/docs/commands/SoundPlay.htm" rel="nofollow noreferrer">documentation</a> says: </p> <blockquote> <p>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.</p> </blockquote> <p>Possible fixes mentioned in the article <a href="http://blogs.msdn.com/b/jongallant/archive/2007/05/23/how-to-play-24-bit-wav-files-in-windows-media-player-media-encoder.aspx?PageIndex=2#comments" rel="nofollow noreferrer">How to play 24bit WAV files in Windows Media Player</a> are fixing the problem for Windows Media Player, however but not for autohotkey: </p> <p><strong>Step-by-step guide</strong></p> <ol> <li>Download <a href="http://chrisnet.net/code.htm" rel="nofollow noreferrer">Legacy HD Audio Filter</a></li> <li>regsvr32.exe AudioTypeConvert.ax </li> <li>Play 24bit file in windows media player (works) and AHK (no sound). </li> <li>regsvr32.exe /u AudioTypeConvert.ax to uninstall </li> </ol> <p>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.</p> <p><strong>Further Investigation</strong></p> <p>As mentioned in the AutoHotKey forums SoundPlay is using <a href="http://msdn.microsoft.com/en-us/library/ms709492%28v=vs.85%29.aspx" rel="nofollow noreferrer">mciSendString</a> under the hood and more information on the nature of the error can be gained by calling it directly. </p> <p>Using the mciSendString alternative DLL call I get <a href="http://msdn.microsoft.com/en-us/library/aa228215%28v=vs.60%29.aspx" rel="nofollow noreferrer">error message 320</a> which corresponds to <a href="http://msdn.microsoft.com/en-us/library/ms713501%28v=vs.85%29.aspx" rel="nofollow noreferrer">MCIERR_WAVE_OUTPUTSINUSE</a></p> <blockquote> <p>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.</p> </blockquote> <p>How do I play 24bit audio files in Windows XP in my AutoHotkey app?</p> <p><strong>SoundPlay based Test app</strong> (<a href="http://amasan.co.uk/downloads/bard/TestApp.ahk" rel="nofollow noreferrer">download</a>)</p> <pre><code>#NoEnv SetWorkingDir %A_ScriptDir% FileSelectFile, f SoundPlay, %f% Msgbox, You should hear audio - except for 24bit wave files under Windows XP. </code></pre> <p><strong>MCI based test app</strong> (<a href="http://amasan.co.uk/downloads/bard/TestApp2.ahk" rel="nofollow noreferrer">download</a>)</p> <pre><code>#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 } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload