title: MessageBeep not playing any sound
body: <p>I'm trying to use the <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms680356%28v=vs.85%29.aspx?f=255&amp;MSPPError=-2147217396" rel="nofollow noreferrer"><code>MessageBeep</code></a> API to play a sound, but no sound plays.</p>
  
  <pre><code>MessageBeep(MB_ICONINFORMATION);
  MessageBeep(MB_ICONASTERISK);
  MessageBeep(MB_ICONEXCLAMATION);
  MessageBeep(MB_ICONERROR);
  MessageBeep(MB_ICONHAND);
  MessageBeep(MB_ICONINFORMATION);
  MessageBeep(MB_ICONQUESTION);
  MessageBeep(MB_ICONSTOP);
  MessageBeep(MB_ICONWARNING);
  MessageBeep(MB_OK);
  </code></pre>
  
  <ul>
  <li>Yes have speakers plugged in</li>
  <li>Yes the volume is turned up</li>
  <li>Yes i hear other MessageBeeps (UAC, Default, Error, etc)</li>
  <li>Yes i hear audio from other application (<a href="https://youtu.be/VbmOvLEqCmA" rel="nofollow noreferrer">what i'm listing to right now is irocnical</a>)</li>
  <li>Windows 10.0.14393 64-bit</li>
  <li>Interactively connected (i.e. not through terminal services remote desktop session)</li>
  <li><p>the function (which returns a <code>BOOL</code>) returns <code>true</code></p>
  
  <p><a href="https://youtu.be/VbmOvLEqCmA" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/cb479.png" alt="enter image description here"></a></p></li>
  <li><p>Yes there is a <em>"Default"</em> sound set in the Sounds applet of the Control Panel</p>
  
  <p><a href="https://youtu.be/VbmOvLEqCmA" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1Gqyc.png" alt="enter image description here"></a></p></li>
  <li>The <strong>Beep</strong> service is started (although the <code>Beep</code> function is not relevant here)</li>
  <li><p>Applications are not allowed to take exclusive control of my default (and only) sound device:</p>
  
  <p><a href="https://i.stack.imgur.com/cb479.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/yDPeC.png" alt="enter image description here"></a></p></li>
  <li><p>Windows does not <em>attempt</em> to play any sound; you can see no "output levels" in the Volume Mixer:</p>
  
  <p><a href="https://i.stack.imgur.com/Or9jY.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Or9jY.png" alt="enter image description here"></a></p></li>
  </ul>
  
  <p>What am I missing?</p>
  
  <h2>Sample code to reproduce the problem</h2>
  
  <pre><code>procedure TForm4.Button1Click(Sender: TObject);
  begin
      MessageBox(0, 'About to play sounds', 'TestApp', MB_OK);
  
       MessageBeep(MB_ICONINFORMATION);
       MessageBeep(MB_ICONASTERISK);
       MessageBeep(MB_ICONEXCLAMATION);
       MessageBeep(MB_ICONERROR);
       MessageBeep(MB_ICONHAND);
       MessageBeep(MB_ICONINFORMATION);
       MessageBeep(MB_ICONQUESTION);
       MessageBeep(MB_ICONSTOP);
       MessageBeep(MB_ICONWARNING);
       MessageBeep(MB_OK);
       MessageBeep($ffffffff);
      MessageBox(0, 'After playing sounds', 'TestApp', MB_OK);
  end;
  </code></pre>
  
  <p>Tested on:</p>
  
  <ul>
  <li>Windows 10 64-bit</li>
  <li>Windows 7 64-bit</li>
  <li><p>Windows 7 64-bit</p></li>
  <li><p>Delphi 5</p>
  
  <p><a href="https://i.stack.imgur.com/cb479.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/X712S.png" alt="enter image description here"></a></p></li>
  <li><p>Delphi 7</p>
  
  <p><a href="https://i.stack.imgur.com/cb479.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/s8N6i.png" alt="enter image description here"></a>  </p></li>
  <li><p>Delphi XE6</p>
  
  <p><a href="https://i.stack.imgur.com/yDPeC.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/dInZW.png" alt="enter image description here"></a></p></li>
  </ul>
  
  <h2>See Also</h2>
  
  <ul>
  <li><a href="https://social.msdn.microsoft.com/Forums/vstudio/en-US/cb144952-d1c5-41c8-9a50-841b6fb4a538/no-sound-from-messagebeep?forum=vclanguage" rel="nofollow noreferrer">MSDN Forums: No sound from MessageBeep()</a> (<a href="http://archive.is/pYbSs" rel="nofollow noreferrer">archive</a>)</li>
  </ul>
  
  <h2>Bonus Reading</h2>
  
  <ul>
  <li><p><a href="https://blogs.msdn.microsoft.com/larryosterman/2010/01/04/whats-up-with-the-beep-driver-in-windows-7/" rel="nofollow noreferrer">Larry Osterman: What’s up with the Beep driver in Windows 7?</a></p>
  
  <p>The Windows <code>Beep</code> function was re-engineered starting with Windows 7 to no longer use the PC speaker, and now uses the default sound device. </p></li>
  </ul>