blob: eacab3be342bb663360adc38e0a27f2991d3d893 [file] [log] [blame]
Fred Drakec7b72db1999-02-16 19:18:38 +00001\section{\module{winsound} ---
2 Sound-playing interface for Windows}
3
4\declaremodule{builtin}{winsound}
Fred Drakef6863c11999-03-02 16:37:17 +00005 \platform{Windows}
Fred Drakec7b72db1999-02-16 19:18:38 +00006\modulesynopsis{Access to the sound-playing machinery for Windows.}
7\moduleauthor{Toby Dickenson}{htrd90@zepler.org}
8\sectionauthor{Fred L. Drake, Jr.}{fdrake@acm.org}
9
Fred Drakef6346341999-02-19 15:46:38 +000010\versionadded{1.5.2}
Fred Drakec7b72db1999-02-16 19:18:38 +000011
12The \module{winsound} module provides access to the basic
13sound-playing machinery provided by Windows platforms. It includes a
14single function and several constants.
15
16
17\begin{funcdesc}{PlaySound}{sound, flags}
18 Call the underlying \cfunction{PlaySound()} function from the
19 Platform API. The \var{sound} parameter may be a filename, audio
20 data as a string, or \code{None}. Its interpretation depends on the
21 value of \var{flags}, which can be a bit-wise ORed combination of
22 the constants described below. If the system indicates an error,
23 \exception{RuntimeError} is raised.
24\end{funcdesc}
25
26
27\begin{datadesc}{SND_FILENAME}
28 The \var{sound} parameter is the name of a WAV file.
29\end{datadesc}
30
31\begin{datadesc}{SND_ALIAS}
32 The \var{sound} parameter should be interpreted as a control panel
33 sound association name.
34\end{datadesc}
35
36\begin{datadesc}{SND_LOOP}
37 Play the sound repeatedly. The \constant{SND_ASYNC} flag must also
38 be used to avoid blocking.
39\end{datadesc}
40
41\begin{datadesc}{SND_MEMORY}
42 The \var{sound} parameter to \function{PlaySound()} is a memory
43 image of a WAV file.
44
45 \strong{Note:} This module does not support playing from a memory
46 image asynchonously, so a combination of this flag and
47 \constant{SND_ASYNC} will raise a \exception{RuntimeError}.
48\end{datadesc}
49
50\begin{datadesc}{SND_PURGE}
51 Stop playing all instances of the specified sound.
52\end{datadesc}
53
54\begin{datadesc}{SND_ASYNC}
55 Return immediately, allowing sounds to play asynchronously.
56\end{datadesc}
57
58\begin{datadesc}{SND_NODEFAULT}
59 If the specified sound cannot be found, do not play a default beep.
60\end{datadesc}
61
62\begin{datadesc}{SND_NOSTOP}
63 Do not interrupt sounds currently playing.
64\end{datadesc}
65
66\begin{datadesc}{SND_NOWAIT}
67 Return immediately if the sound driver is busy.
68\end{datadesc}