gooderp18绿色标准版
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

485 lines
29KB

  1. <!DOCTYPE html>
  2. <html lang="en" data-content_root="../">
  3. <head>
  4. <meta charset="utf-8" />
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" />
  6. <meta property="og:title" content="winsound — Sound-playing interface for Windows" />
  7. <meta property="og:type" content="website" />
  8. <meta property="og:url" content="https://docs.python.org/3/library/winsound.html" />
  9. <meta property="og:site_name" content="Python documentation" />
  10. <meta property="og:description" content="The winsound module provides access to the basic sound-playing machinery provided by Windows platforms. It includes functions and several constants." />
  11. <meta property="og:image" content="https://docs.python.org/3/_static/og-image.png" />
  12. <meta property="og:image:alt" content="Python documentation" />
  13. <meta name="description" content="The winsound module provides access to the basic sound-playing machinery provided by Windows platforms. It includes functions and several constants." />
  14. <meta property="og:image:width" content="200" />
  15. <meta property="og:image:height" content="200" />
  16. <meta name="theme-color" content="#3776ab" />
  17. <title>winsound — Sound-playing interface for Windows &#8212; Python 3.12.3 documentation</title><meta name="viewport" content="width=device-width, initial-scale=1.0">
  18. <link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=80d5e7a1" />
  19. <link rel="stylesheet" type="text/css" href="../_static/pydoctheme.css?v=bb723527" />
  20. <link id="pygments_dark_css" media="(prefers-color-scheme: dark)" rel="stylesheet" type="text/css" href="../_static/pygments_dark.css?v=b20cc3f5" />
  21. <script src="../_static/documentation_options.js?v=2c828074"></script>
  22. <script src="../_static/doctools.js?v=888ff710"></script>
  23. <script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
  24. <script src="../_static/sidebar.js"></script>
  25. <link rel="search" type="application/opensearchdescription+xml"
  26. title="Search within Python 3.12.3 documentation"
  27. href="../_static/opensearch.xml"/>
  28. <link rel="author" title="About these documents" href="../about.html" />
  29. <link rel="index" title="Index" href="../genindex.html" />
  30. <link rel="search" title="Search" href="../search.html" />
  31. <link rel="copyright" title="Copyright" href="../copyright.html" />
  32. <link rel="next" title="Unix Specific Services" href="unix.html" />
  33. <link rel="prev" title="winreg — Windows registry access" href="winreg.html" />
  34. <link rel="canonical" href="https://docs.python.org/3/library/winsound.html" />
  35. <style>
  36. @media only screen {
  37. table.full-width-table {
  38. width: 100%;
  39. }
  40. }
  41. </style>
  42. <link rel="stylesheet" href="../_static/pydoctheme_dark.css" media="(prefers-color-scheme: dark)" id="pydoctheme_dark_css">
  43. <link rel="shortcut icon" type="image/png" href="../_static/py.svg" />
  44. <script type="text/javascript" src="../_static/copybutton.js"></script>
  45. <script type="text/javascript" src="../_static/menu.js"></script>
  46. <script type="text/javascript" src="../_static/search-focus.js"></script>
  47. <script type="text/javascript" src="../_static/themetoggle.js"></script>
  48. </head>
  49. <body>
  50. <div class="mobile-nav">
  51. <input type="checkbox" id="menuToggler" class="toggler__input" aria-controls="navigation"
  52. aria-pressed="false" aria-expanded="false" role="button" aria-label="Menu" />
  53. <nav class="nav-content" role="navigation">
  54. <label for="menuToggler" class="toggler__label">
  55. <span></span>
  56. </label>
  57. <span class="nav-items-wrapper">
  58. <a href="https://www.python.org/" class="nav-logo">
  59. <img src="../_static/py.svg" alt="Python logo"/>
  60. </a>
  61. <span class="version_switcher_placeholder"></span>
  62. <form role="search" class="search" action="../search.html" method="get">
  63. <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" class="search-icon">
  64. <path fill-rule="nonzero" fill="currentColor" d="M15.5 14h-.79l-.28-.27a6.5 6.5 0 001.48-5.34c-.47-2.78-2.79-5-5.59-5.34a6.505 6.505 0 00-7.27 7.27c.34 2.8 2.56 5.12 5.34 5.59a6.5 6.5 0 005.34-1.48l.27.28v.79l4.25 4.25c.41.41 1.08.41 1.49 0 .41-.41.41-1.08 0-1.49L15.5 14zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"></path>
  65. </svg>
  66. <input placeholder="Quick search" aria-label="Quick search" type="search" name="q" />
  67. <input type="submit" value="Go"/>
  68. </form>
  69. </span>
  70. </nav>
  71. <div class="menu-wrapper">
  72. <nav class="menu" role="navigation" aria-label="main navigation">
  73. <div class="language_switcher_placeholder"></div>
  74. <label class="theme-selector-label">
  75. Theme
  76. <select class="theme-selector" oninput="activateTheme(this.value)">
  77. <option value="auto" selected>Auto</option>
  78. <option value="light">Light</option>
  79. <option value="dark">Dark</option>
  80. </select>
  81. </label>
  82. <div>
  83. <h4>Previous topic</h4>
  84. <p class="topless"><a href="winreg.html"
  85. title="previous chapter"><code class="xref py py-mod docutils literal notranslate"><span class="pre">winreg</span></code> — Windows registry access</a></p>
  86. </div>
  87. <div>
  88. <h4>Next topic</h4>
  89. <p class="topless"><a href="unix.html"
  90. title="next chapter">Unix Specific Services</a></p>
  91. </div>
  92. <div role="note" aria-label="source link">
  93. <h3>This Page</h3>
  94. <ul class="this-page-menu">
  95. <li><a href="../bugs.html">Report a Bug</a></li>
  96. <li>
  97. <a href="https://github.com/python/cpython/blob/main/Doc/library/winsound.rst"
  98. rel="nofollow">Show Source
  99. </a>
  100. </li>
  101. </ul>
  102. </div>
  103. </nav>
  104. </div>
  105. </div>
  106. <div class="related" role="navigation" aria-label="related navigation">
  107. <h3>Navigation</h3>
  108. <ul>
  109. <li class="right" style="margin-right: 10px">
  110. <a href="../genindex.html" title="General Index"
  111. accesskey="I">index</a></li>
  112. <li class="right" >
  113. <a href="../py-modindex.html" title="Python Module Index"
  114. >modules</a> |</li>
  115. <li class="right" >
  116. <a href="unix.html" title="Unix Specific Services"
  117. accesskey="N">next</a> |</li>
  118. <li class="right" >
  119. <a href="winreg.html" title="winreg — Windows registry access"
  120. accesskey="P">previous</a> |</li>
  121. <li><img src="../_static/py.svg" alt="Python logo" style="vertical-align: middle; margin-top: -1px"/></li>
  122. <li><a href="https://www.python.org/">Python</a> &#187;</li>
  123. <li class="switchers">
  124. <div class="language_switcher_placeholder"></div>
  125. <div class="version_switcher_placeholder"></div>
  126. </li>
  127. <li>
  128. </li>
  129. <li id="cpython-language-and-version">
  130. <a href="../index.html">3.12.3 Documentation</a> &#187;
  131. </li>
  132. <li class="nav-item nav-item-1"><a href="index.html" >The Python Standard Library</a> &#187;</li>
  133. <li class="nav-item nav-item-2"><a href="windows.html" accesskey="U">MS Windows Specific Services</a> &#187;</li>
  134. <li class="nav-item nav-item-this"><a href=""><code class="xref py py-mod docutils literal notranslate"><span class="pre">winsound</span></code> — Sound-playing interface for Windows</a></li>
  135. <li class="right">
  136. <div class="inline-search" role="search">
  137. <form class="inline-search" action="../search.html" method="get">
  138. <input placeholder="Quick search" aria-label="Quick search" type="search" name="q" id="search-box" />
  139. <input type="submit" value="Go" />
  140. </form>
  141. </div>
  142. |
  143. </li>
  144. <li class="right">
  145. <label class="theme-selector-label">
  146. Theme
  147. <select class="theme-selector" oninput="activateTheme(this.value)">
  148. <option value="auto" selected>Auto</option>
  149. <option value="light">Light</option>
  150. <option value="dark">Dark</option>
  151. </select>
  152. </label> |</li>
  153. </ul>
  154. </div>
  155. <div class="document">
  156. <div class="documentwrapper">
  157. <div class="bodywrapper">
  158. <div class="body" role="main">
  159. <section id="module-winsound">
  160. <span id="winsound-sound-playing-interface-for-windows"></span><h1><a class="reference internal" href="#module-winsound" title="winsound: Access to the sound-playing machinery for Windows. (Windows)"><code class="xref py py-mod docutils literal notranslate"><span class="pre">winsound</span></code></a> — Sound-playing interface for Windows<a class="headerlink" href="#module-winsound" title="Link to this heading">¶</a></h1>
  161. <hr class="docutils" />
  162. <p>The <a class="reference internal" href="#module-winsound" title="winsound: Access to the sound-playing machinery for Windows. (Windows)"><code class="xref py py-mod docutils literal notranslate"><span class="pre">winsound</span></code></a> module provides access to the basic sound-playing machinery
  163. provided by Windows platforms. It includes functions and several constants.</p>
  164. <dl class="py function">
  165. <dt class="sig sig-object py" id="winsound.Beep">
  166. <span class="sig-prename descclassname"><span class="pre">winsound.</span></span><span class="sig-name descname"><span class="pre">Beep</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">frequency</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">duration</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#winsound.Beep" title="Link to this definition">¶</a></dt>
  167. <dd><p>Beep the PC’s speaker. The <em>frequency</em> parameter specifies frequency, in hertz,
  168. of the sound, and must be in the range 37 through 32,767. The <em>duration</em>
  169. parameter specifies the number of milliseconds the sound should last. If the
  170. system is not able to beep the speaker, <a class="reference internal" href="exceptions.html#RuntimeError" title="RuntimeError"><code class="xref py py-exc docutils literal notranslate"><span class="pre">RuntimeError</span></code></a> is raised.</p>
  171. </dd></dl>
  172. <dl class="py function">
  173. <dt class="sig sig-object py" id="winsound.PlaySound">
  174. <span class="sig-prename descclassname"><span class="pre">winsound.</span></span><span class="sig-name descname"><span class="pre">PlaySound</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">sound</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">flags</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#winsound.PlaySound" title="Link to this definition">¶</a></dt>
  175. <dd><p>Call the underlying <code class="xref c c-func docutils literal notranslate"><span class="pre">PlaySound()</span></code> function from the Platform API. The
  176. <em>sound</em> parameter may be a filename, a system sound alias, audio data as a
  177. <a class="reference internal" href="../glossary.html#term-bytes-like-object"><span class="xref std std-term">bytes-like object</span></a>, or <code class="docutils literal notranslate"><span class="pre">None</span></code>. Its
  178. interpretation depends on the value of <em>flags</em>, which can be a bitwise ORed
  179. combination of the constants described below. If the <em>sound</em> parameter is
  180. <code class="docutils literal notranslate"><span class="pre">None</span></code>, any currently playing waveform sound is stopped. If the system
  181. indicates an error, <a class="reference internal" href="exceptions.html#RuntimeError" title="RuntimeError"><code class="xref py py-exc docutils literal notranslate"><span class="pre">RuntimeError</span></code></a> is raised.</p>
  182. </dd></dl>
  183. <dl class="py function">
  184. <dt class="sig sig-object py" id="winsound.MessageBeep">
  185. <span class="sig-prename descclassname"><span class="pre">winsound.</span></span><span class="sig-name descname"><span class="pre">MessageBeep</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">type</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">MB_OK</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#winsound.MessageBeep" title="Link to this definition">¶</a></dt>
  186. <dd><p>Call the underlying <code class="xref c c-func docutils literal notranslate"><span class="pre">MessageBeep()</span></code> function from the Platform API. This
  187. plays a sound as specified in the registry. The <em>type</em> argument specifies which
  188. sound to play; possible values are <code class="docutils literal notranslate"><span class="pre">-1</span></code>, <code class="docutils literal notranslate"><span class="pre">MB_ICONASTERISK</span></code>,
  189. <code class="docutils literal notranslate"><span class="pre">MB_ICONEXCLAMATION</span></code>, <code class="docutils literal notranslate"><span class="pre">MB_ICONHAND</span></code>, <code class="docutils literal notranslate"><span class="pre">MB_ICONQUESTION</span></code>, and <code class="docutils literal notranslate"><span class="pre">MB_OK</span></code>, all
  190. described below. The value <code class="docutils literal notranslate"><span class="pre">-1</span></code> produces a “simple beep”; this is the final
  191. fallback if a sound cannot be played otherwise. If the system indicates an
  192. error, <a class="reference internal" href="exceptions.html#RuntimeError" title="RuntimeError"><code class="xref py py-exc docutils literal notranslate"><span class="pre">RuntimeError</span></code></a> is raised.</p>
  193. </dd></dl>
  194. <dl class="py data">
  195. <dt class="sig sig-object py" id="winsound.SND_FILENAME">
  196. <span class="sig-prename descclassname"><span class="pre">winsound.</span></span><span class="sig-name descname"><span class="pre">SND_FILENAME</span></span><a class="headerlink" href="#winsound.SND_FILENAME" title="Link to this definition">¶</a></dt>
  197. <dd><p>The <em>sound</em> parameter is the name of a WAV file. Do not use with
  198. <a class="reference internal" href="#winsound.SND_ALIAS" title="winsound.SND_ALIAS"><code class="xref py py-const docutils literal notranslate"><span class="pre">SND_ALIAS</span></code></a>.</p>
  199. </dd></dl>
  200. <dl class="py data">
  201. <dt class="sig sig-object py" id="winsound.SND_ALIAS">
  202. <span class="sig-prename descclassname"><span class="pre">winsound.</span></span><span class="sig-name descname"><span class="pre">SND_ALIAS</span></span><a class="headerlink" href="#winsound.SND_ALIAS" title="Link to this definition">¶</a></dt>
  203. <dd><p>The <em>sound</em> parameter is a sound association name from the registry. If the
  204. registry contains no such name, play the system default sound unless
  205. <a class="reference internal" href="#winsound.SND_NODEFAULT" title="winsound.SND_NODEFAULT"><code class="xref py py-const docutils literal notranslate"><span class="pre">SND_NODEFAULT</span></code></a> is also specified. If no default sound is registered,
  206. raise <a class="reference internal" href="exceptions.html#RuntimeError" title="RuntimeError"><code class="xref py py-exc docutils literal notranslate"><span class="pre">RuntimeError</span></code></a>. Do not use with <a class="reference internal" href="#winsound.SND_FILENAME" title="winsound.SND_FILENAME"><code class="xref py py-const docutils literal notranslate"><span class="pre">SND_FILENAME</span></code></a>.</p>
  207. <p>All Win32 systems support at least the following; most systems support many
  208. more:</p>
  209. <table class="docutils align-default">
  210. <thead>
  211. <tr class="row-odd"><th class="head"><p><a class="reference internal" href="#winsound.PlaySound" title="winsound.PlaySound"><code class="xref py py-func docutils literal notranslate"><span class="pre">PlaySound()</span></code></a> <em>name</em></p></th>
  212. <th class="head"><p>Corresponding Control Panel Sound name</p></th>
  213. </tr>
  214. </thead>
  215. <tbody>
  216. <tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">'SystemAsterisk'</span></code></p></td>
  217. <td><p>Asterisk</p></td>
  218. </tr>
  219. <tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">'SystemExclamation'</span></code></p></td>
  220. <td><p>Exclamation</p></td>
  221. </tr>
  222. <tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">'SystemExit'</span></code></p></td>
  223. <td><p>Exit Windows</p></td>
  224. </tr>
  225. <tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">'SystemHand'</span></code></p></td>
  226. <td><p>Critical Stop</p></td>
  227. </tr>
  228. <tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">'SystemQuestion'</span></code></p></td>
  229. <td><p>Question</p></td>
  230. </tr>
  231. </tbody>
  232. </table>
  233. <p>For example:</p>
  234. <div class="highlight-python3 notranslate"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">winsound</span>
  235. <span class="c1"># Play Windows exit sound.</span>
  236. <span class="n">winsound</span><span class="o">.</span><span class="n">PlaySound</span><span class="p">(</span><span class="s2">&quot;SystemExit&quot;</span><span class="p">,</span> <span class="n">winsound</span><span class="o">.</span><span class="n">SND_ALIAS</span><span class="p">)</span>
  237. <span class="c1"># Probably play Windows default sound, if any is registered (because</span>
  238. <span class="c1"># &quot;*&quot; probably isn&#39;t the registered name of any sound).</span>
  239. <span class="n">winsound</span><span class="o">.</span><span class="n">PlaySound</span><span class="p">(</span><span class="s2">&quot;*&quot;</span><span class="p">,</span> <span class="n">winsound</span><span class="o">.</span><span class="n">SND_ALIAS</span><span class="p">)</span>
  240. </pre></div>
  241. </div>
  242. </dd></dl>
  243. <dl class="py data">
  244. <dt class="sig sig-object py" id="winsound.SND_LOOP">
  245. <span class="sig-prename descclassname"><span class="pre">winsound.</span></span><span class="sig-name descname"><span class="pre">SND_LOOP</span></span><a class="headerlink" href="#winsound.SND_LOOP" title="Link to this definition">¶</a></dt>
  246. <dd><p>Play the sound repeatedly. The <a class="reference internal" href="#winsound.SND_ASYNC" title="winsound.SND_ASYNC"><code class="xref py py-const docutils literal notranslate"><span class="pre">SND_ASYNC</span></code></a> flag must also be used to
  247. avoid blocking. Cannot be used with <a class="reference internal" href="#winsound.SND_MEMORY" title="winsound.SND_MEMORY"><code class="xref py py-const docutils literal notranslate"><span class="pre">SND_MEMORY</span></code></a>.</p>
  248. </dd></dl>
  249. <dl class="py data">
  250. <dt class="sig sig-object py" id="winsound.SND_MEMORY">
  251. <span class="sig-prename descclassname"><span class="pre">winsound.</span></span><span class="sig-name descname"><span class="pre">SND_MEMORY</span></span><a class="headerlink" href="#winsound.SND_MEMORY" title="Link to this definition">¶</a></dt>
  252. <dd><p>The <em>sound</em> parameter to <a class="reference internal" href="#winsound.PlaySound" title="winsound.PlaySound"><code class="xref py py-func docutils literal notranslate"><span class="pre">PlaySound()</span></code></a> is a memory image of a WAV file, as a
  253. <a class="reference internal" href="../glossary.html#term-bytes-like-object"><span class="xref std std-term">bytes-like object</span></a>.</p>
  254. <div class="admonition note">
  255. <p class="admonition-title">Note</p>
  256. <p>This module does not support playing from a memory image asynchronously, so a
  257. combination of this flag and <a class="reference internal" href="#winsound.SND_ASYNC" title="winsound.SND_ASYNC"><code class="xref py py-const docutils literal notranslate"><span class="pre">SND_ASYNC</span></code></a> will raise <a class="reference internal" href="exceptions.html#RuntimeError" title="RuntimeError"><code class="xref py py-exc docutils literal notranslate"><span class="pre">RuntimeError</span></code></a>.</p>
  258. </div>
  259. </dd></dl>
  260. <dl class="py data">
  261. <dt class="sig sig-object py" id="winsound.SND_PURGE">
  262. <span class="sig-prename descclassname"><span class="pre">winsound.</span></span><span class="sig-name descname"><span class="pre">SND_PURGE</span></span><a class="headerlink" href="#winsound.SND_PURGE" title="Link to this definition">¶</a></dt>
  263. <dd><p>Stop playing all instances of the specified sound.</p>
  264. <div class="admonition note">
  265. <p class="admonition-title">Note</p>
  266. <p>This flag is not supported on modern Windows platforms.</p>
  267. </div>
  268. </dd></dl>
  269. <dl class="py data">
  270. <dt class="sig sig-object py" id="winsound.SND_ASYNC">
  271. <span class="sig-prename descclassname"><span class="pre">winsound.</span></span><span class="sig-name descname"><span class="pre">SND_ASYNC</span></span><a class="headerlink" href="#winsound.SND_ASYNC" title="Link to this definition">¶</a></dt>
  272. <dd><p>Return immediately, allowing sounds to play asynchronously.</p>
  273. </dd></dl>
  274. <dl class="py data">
  275. <dt class="sig sig-object py" id="winsound.SND_NODEFAULT">
  276. <span class="sig-prename descclassname"><span class="pre">winsound.</span></span><span class="sig-name descname"><span class="pre">SND_NODEFAULT</span></span><a class="headerlink" href="#winsound.SND_NODEFAULT" title="Link to this definition">¶</a></dt>
  277. <dd><p>If the specified sound cannot be found, do not play the system default sound.</p>
  278. </dd></dl>
  279. <dl class="py data">
  280. <dt class="sig sig-object py" id="winsound.SND_NOSTOP">
  281. <span class="sig-prename descclassname"><span class="pre">winsound.</span></span><span class="sig-name descname"><span class="pre">SND_NOSTOP</span></span><a class="headerlink" href="#winsound.SND_NOSTOP" title="Link to this definition">¶</a></dt>
  282. <dd><p>Do not interrupt sounds currently playing.</p>
  283. </dd></dl>
  284. <dl class="py data">
  285. <dt class="sig sig-object py" id="winsound.SND_NOWAIT">
  286. <span class="sig-prename descclassname"><span class="pre">winsound.</span></span><span class="sig-name descname"><span class="pre">SND_NOWAIT</span></span><a class="headerlink" href="#winsound.SND_NOWAIT" title="Link to this definition">¶</a></dt>
  287. <dd><p>Return immediately if the sound driver is busy.</p>
  288. <div class="admonition note">
  289. <p class="admonition-title">Note</p>
  290. <p>This flag is not supported on modern Windows platforms.</p>
  291. </div>
  292. </dd></dl>
  293. <dl class="py data">
  294. <dt class="sig sig-object py" id="winsound.MB_ICONASTERISK">
  295. <span class="sig-prename descclassname"><span class="pre">winsound.</span></span><span class="sig-name descname"><span class="pre">MB_ICONASTERISK</span></span><a class="headerlink" href="#winsound.MB_ICONASTERISK" title="Link to this definition">¶</a></dt>
  296. <dd><p>Play the <code class="docutils literal notranslate"><span class="pre">SystemDefault</span></code> sound.</p>
  297. </dd></dl>
  298. <dl class="py data">
  299. <dt class="sig sig-object py" id="winsound.MB_ICONEXCLAMATION">
  300. <span class="sig-prename descclassname"><span class="pre">winsound.</span></span><span class="sig-name descname"><span class="pre">MB_ICONEXCLAMATION</span></span><a class="headerlink" href="#winsound.MB_ICONEXCLAMATION" title="Link to this definition">¶</a></dt>
  301. <dd><p>Play the <code class="docutils literal notranslate"><span class="pre">SystemExclamation</span></code> sound.</p>
  302. </dd></dl>
  303. <dl class="py data">
  304. <dt class="sig sig-object py" id="winsound.MB_ICONHAND">
  305. <span class="sig-prename descclassname"><span class="pre">winsound.</span></span><span class="sig-name descname"><span class="pre">MB_ICONHAND</span></span><a class="headerlink" href="#winsound.MB_ICONHAND" title="Link to this definition">¶</a></dt>
  306. <dd><p>Play the <code class="docutils literal notranslate"><span class="pre">SystemHand</span></code> sound.</p>
  307. </dd></dl>
  308. <dl class="py data">
  309. <dt class="sig sig-object py" id="winsound.MB_ICONQUESTION">
  310. <span class="sig-prename descclassname"><span class="pre">winsound.</span></span><span class="sig-name descname"><span class="pre">MB_ICONQUESTION</span></span><a class="headerlink" href="#winsound.MB_ICONQUESTION" title="Link to this definition">¶</a></dt>
  311. <dd><p>Play the <code class="docutils literal notranslate"><span class="pre">SystemQuestion</span></code> sound.</p>
  312. </dd></dl>
  313. <dl class="py data">
  314. <dt class="sig sig-object py" id="winsound.MB_OK">
  315. <span class="sig-prename descclassname"><span class="pre">winsound.</span></span><span class="sig-name descname"><span class="pre">MB_OK</span></span><a class="headerlink" href="#winsound.MB_OK" title="Link to this definition">¶</a></dt>
  316. <dd><p>Play the <code class="docutils literal notranslate"><span class="pre">SystemDefault</span></code> sound.</p>
  317. </dd></dl>
  318. </section>
  319. <div class="clearer"></div>
  320. </div>
  321. </div>
  322. </div>
  323. <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
  324. <div class="sphinxsidebarwrapper">
  325. <div>
  326. <h4>Previous topic</h4>
  327. <p class="topless"><a href="winreg.html"
  328. title="previous chapter"><code class="xref py py-mod docutils literal notranslate"><span class="pre">winreg</span></code> — Windows registry access</a></p>
  329. </div>
  330. <div>
  331. <h4>Next topic</h4>
  332. <p class="topless"><a href="unix.html"
  333. title="next chapter">Unix Specific Services</a></p>
  334. </div>
  335. <div role="note" aria-label="source link">
  336. <h3>This Page</h3>
  337. <ul class="this-page-menu">
  338. <li><a href="../bugs.html">Report a Bug</a></li>
  339. <li>
  340. <a href="https://github.com/python/cpython/blob/main/Doc/library/winsound.rst"
  341. rel="nofollow">Show Source
  342. </a>
  343. </li>
  344. </ul>
  345. </div>
  346. </div>
  347. <div id="sidebarbutton" title="Collapse sidebar">
  348. <span>«</span>
  349. </div>
  350. </div>
  351. <div class="clearer"></div>
  352. </div>
  353. <div class="related" role="navigation" aria-label="related navigation">
  354. <h3>Navigation</h3>
  355. <ul>
  356. <li class="right" style="margin-right: 10px">
  357. <a href="../genindex.html" title="General Index"
  358. >index</a></li>
  359. <li class="right" >
  360. <a href="../py-modindex.html" title="Python Module Index"
  361. >modules</a> |</li>
  362. <li class="right" >
  363. <a href="unix.html" title="Unix Specific Services"
  364. >next</a> |</li>
  365. <li class="right" >
  366. <a href="winreg.html" title="winreg — Windows registry access"
  367. >previous</a> |</li>
  368. <li><img src="../_static/py.svg" alt="Python logo" style="vertical-align: middle; margin-top: -1px"/></li>
  369. <li><a href="https://www.python.org/">Python</a> &#187;</li>
  370. <li class="switchers">
  371. <div class="language_switcher_placeholder"></div>
  372. <div class="version_switcher_placeholder"></div>
  373. </li>
  374. <li>
  375. </li>
  376. <li id="cpython-language-and-version">
  377. <a href="../index.html">3.12.3 Documentation</a> &#187;
  378. </li>
  379. <li class="nav-item nav-item-1"><a href="index.html" >The Python Standard Library</a> &#187;</li>
  380. <li class="nav-item nav-item-2"><a href="windows.html" >MS Windows Specific Services</a> &#187;</li>
  381. <li class="nav-item nav-item-this"><a href=""><code class="xref py py-mod docutils literal notranslate"><span class="pre">winsound</span></code> — Sound-playing interface for Windows</a></li>
  382. <li class="right">
  383. <div class="inline-search" role="search">
  384. <form class="inline-search" action="../search.html" method="get">
  385. <input placeholder="Quick search" aria-label="Quick search" type="search" name="q" id="search-box" />
  386. <input type="submit" value="Go" />
  387. </form>
  388. </div>
  389. |
  390. </li>
  391. <li class="right">
  392. <label class="theme-selector-label">
  393. Theme
  394. <select class="theme-selector" oninput="activateTheme(this.value)">
  395. <option value="auto" selected>Auto</option>
  396. <option value="light">Light</option>
  397. <option value="dark">Dark</option>
  398. </select>
  399. </label> |</li>
  400. </ul>
  401. </div>
  402. <div class="footer">
  403. &copy;
  404. <a href="../copyright.html">
  405. Copyright
  406. </a>
  407. 2001-2024, Python Software Foundation.
  408. <br />
  409. This page is licensed under the Python Software Foundation License Version 2.
  410. <br />
  411. Examples, recipes, and other code in the documentation are additionally licensed under the Zero Clause BSD License.
  412. <br />
  413. See <a href="/license.html">History and License</a> for more information.<br />
  414. <br />
  415. The Python Software Foundation is a non-profit corporation.
  416. <a href="https://www.python.org/psf/donations/">Please donate.</a>
  417. <br />
  418. <br />
  419. Last updated on Apr 09, 2024 (13:47 UTC).
  420. <a href="/bugs.html">Found a bug</a>?
  421. <br />
  422. Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 7.2.6.
  423. </div>
  424. </body>
  425. </html>
上海开阖软件有限公司 沪ICP备12045867号-1