📄 qsound.3qt
字号:
'\" t.TH QSound 3qt "24 January 2005" "Trolltech AS" \" -*- nroff -*-.\" Copyright 1992-2001 Trolltech AS. All rights reserved. See the.\" license file included in the distribution for a complete license.\" statement..\".ad l.nh.SH NAMEQSound \- Access to the platform audio facilities.br.PP\fC#include <qsound.h>\fR.PPInherits QObject..PP.SS "Public Members".in +1c.ti -1c.BI "\fBQSound\fR ( const QString & " "filename" ", QObject * " "parent" "=0, const char * " "name" "=0 ) ".br.ti -1c.BI "\fB~QSound\fR () ".br.in -1c.SS "Public Slots".in +1c.ti -1c.BI "void \fBplay\fR () ".br.in -1c.SS "Static Public Members".in +1c.ti -1c.BI "bool \fBavailable\fR () ".br.ti -1c.BI "void \fBplay\fR ( const QString & filename ) ".br.in -1c.SH DESCRIPTIONAccess to the platform audio facilities..PPQt 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:.PP.nf.br QSound::play("mysounds/bells.wav");.fi.PPA second API is provided, where a QSound object is created from a sound file and is later be played:.PP.nf.br QSound bells("mysounds/bells.wav");.br.br bells.play();.fi.PPSounds 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..PPOn Microsoft Windows, the underlying multimedia system is used and hence WAVE format sound files are supported..PPOn X11, the Network Audio System is used if available, otherwise all operations work silently. NAS supports WAVE and AU files..PPOn Qt/Embedded, a built-in mixing sound server is used, which accesses \fC/dev/dsp\fR 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..PPThe availability of sound can be tested with QSound::available()..SH MEMBER FUNCTION DOCUMENTATION.SH "QSound::QSound ( const QString & filename, QObject * parent=0, const char * name=0 )"Constructs a sound which can quickly play the sound in file named \fIfilename.\fR.PPThis can use more memory than the static \fCplay\fR function..PPThe \fIparent\fR and \fIname\fR arguments (default 0) are passed on to the QObject constructor..SH "QSound::~QSound ()"Destructs the sound..SH "bool QSound::available () \fC[static]\fR"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..PPIf no sound is available, QSound operation all work silently and quickly..SH "void QSound::play () \fC[slot]\fR"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..PPThe sound can be played again at any time, possibly mixing or replacing previous plays of the sound..SH "void QSound::play ( const QString & filename ) \fC[static]\fR"Play the sound in file named \fIfilename.\fR.SH "SEE ALSO".BR http://doc.trolltech.com/qsound.html.BR http://www.trolltech.com/faq/tech.html.SH COPYRIGHTCopyright 1992-2001 Trolltech AS, http://www.trolltech.com. See thelicense file included in the distribution for a complete licensestatement..SH AUTHORGenerated automatically from the source code..SH BUGSIf you find a bug in Qt, please report it as described in.BR http://doc.trolltech.com/bughowto.html .Good bug reports make our job much simpler. Thank you..PIn case of content or formattting problems with this manual page, pleasereport them to.BR qt-bugs@trolltech.com .Please include the name of the manual page (qsound.3qt) and the Qtversion (2.3.10).
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -