File: qsound.html

package info (click to toggle)
qt-embedded 2.3.2-3
  • links: PTS
  • area: main
  • in suites: woody
  • size: 68,608 kB
  • ctags: 45,998
  • sloc: cpp: 276,654; ansic: 71,987; makefile: 29,074; sh: 12,305; yacc: 2,465; python: 1,863; perl: 481; lex: 480; xml: 68; lisp: 15
file content (114 lines) | stat: -rw-r--r-- 5,546 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Qt Toolkit - QSound Class</title><style type="text/css"><!--
h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm; }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }body { background: white; color: black; }
--></style>
</head><body bgcolor="#ffffff">

<table width="100%">
<tr><td><a href="index.html">
<img width="100" height="100" src="qtlogo.png"
alt="Home" border="0"><img width="100"
height="100" src="face.png" alt="Home" border="0">
</a><td valign=top><div align=right><img src="dochead.png" width="472" height="27"><br>
<a href="classes.html"><b>Classes</b></a>
-<a href="annotated.html">Annotated</a>
- <a href="hierarchy.html">Tree</a>
-<a href="functions.html">Functions</a>
-<a href="index.html">Home</a>
-<a href="topicals.html"><b>Structure</b></a>
</div>
</table>

<h1 align=center>QSound Class Reference</h1><br clear="all">
<p>
Access to the platform audio facilities.
<a href="#details">More...</a>
<p>
<code>#include &lt;<a href="qsound-h.html">qsound.h</a>&gt;</code>
<p>
Inherits <a href="qobject.html">QObject</a>.
<p><a href="qsound-members.html">List of all member functions.</a>
<h2>Public Members</h2>
<ul>
<li><div class="fn"><a href="#a789c2"><b>QSound</b></a>(constQString&amp;filename, QObject*parent=0, constchar*name=0)</div>
<li><div class="fn"><a href="#30ac9d"><b>~QSound</b></a>()</div>
</ul>
<h2>Public Slots</h2>
<ul>
<li><div class="fn">void<a href="#47064c"><b>play</b></a>()</div>
</ul>
<h2>Static Public Members</h2>
<ul>
<li><div class="fn">bool<a href="#4256cc"><b>available</b></a>()</div>
<li><div class="fn">void<a href="#a57b42"><b>play</b></a>(constQString&amp;filename)</div>
</ul>
<hr><h2><a name="details"></a>Detailed Description</h2>
Access to the platform audio facilities.
<p>
Qt provides the most commonly required audio operation in
GUI applications: playing a sound file asynchronously
to the user. This is most simply accomplished with a single call:
<pre>    <a href="#47064c">QSound::play</a>("mysounds/bells.wav");
</pre>
<p>A second API is provided, where a QSound object is created
from a sound file and is later be played:
<pre>    <a href="qsound.html">QSound</a> bells("mysounds/bells.wav");

    bells.<a href="#47064c">play</a>();
</pre>
<p>Sounds played by the second model may use more memory but play
more immediately than sounds played using the first model, depending
on the underlying platform audio facilities.
<p>On Microsoft Windows, the underlying multimedia system is used and
hence WAVE format sound files are supported.
<p>On X11, the
<a href=ftp://ftp.x.org/contrib/audio/nas/>Network Audio System</a>
is used if available, otherwise all
operations work silently. NAS supports WAVE and AU files.
<p>On Qt/Embedded, a built-in mixing sound server is used, which accesses
<tt>/dev/dsp</tt> directly. Only a single WAVE format is supported,
though that support can be configured when building Qt. The default is
11.025 kHz 8-bit mono PCM.
<p>The availability of sound can be
tested with <a href="#4256cc">QSound::available</a>().

<hr><h2>Member Function Documentation</h2>
<h3 class="fn"><a name="a789c2"></a>QSound::QSound(const<a href="qstring.html">QString</a>&amp;filename, <a href="qobject.html">QObject</a>*parent=0, constchar*name=0)</h3>
<p>Constructs a sound which can quickly play the sound in file
named <em>filename.</em>
<p>This can use more memory than the static <code>play</code> function.
<p>The <em>parent</em> and <em>name</em> arguments (default 0) are passed on to
the <a href="qobject.html">QObject</a> constructor.
<h3 class="fn"><a name="30ac9d"></a>QSound::~QSound()</h3>
<p>Destructs the sound.
<h3 class="fn">bool<a name="4256cc"></a>QSound::available() <code>[static]</code></h3>
<p>Returns TRUE if sound facilities exist on the platform. An
application may choose to notify the user if sound is crucial
the the application, or operate silently without bothering
the user.
<p>If no sound is available, QSound operation all work silently
and quickly.
<h3 class="fn">void<a name="47064c"></a>QSound::play() <code>[slot]</code></h3>
<p>Starts the sound playing.  The function returns immediately.
Depending on the platform audio facilities, other sounds may
stop or may be mixed with the new sound.
<p>The sound can be played again at any time, possibly mixing or
replacing previous plays of the sound.
<h3 class="fn">void<a name="a57b42"></a>QSound::play(const<a href="qstring.html">QString</a>&amp;filename) <code>[static]</code></h3>
<p>Play the sound in file named <em>filename.</em>
<hr><p>
Search the documentation, FAQ, qt-interest archive and more (uses
<a href="http://www.trolltech.com">www.trolltech.com</a>):<br>
<form method=post action="http://www.trolltech.com/search.cgi">
<input type=hidden name="version" value="2.3.2"><nobr>
<input size="50" name="search"><input type=submit value="Search">
</nobr></form><hr><p>
This file is part of the <a href="index.html">Qt toolkit</a>,
copyright &copy; 1995-2001
<a href="http://www.trolltech.com">Trolltech</a>, all rights reserved.<p><address><hr><div align="center">
<table width="100%" cellspacing="0" border="0"><tr>
<td>Copyright  2001 Trolltech<td><a href="http://www.trolltech.com/trademarks.html">Trademarks</a>
<td align="right"><div align="right">Qt version 2.3.2</div>
</table></div></address></body></html>