The QPlatformAudioSink class is a base class for audio backends. 更多...
头: | #include <QPlatformAudioSink> |
CMake: |
find_package(Qt6 COMPONENTS Multimedia REQUIRED)
target_link_libraries(mytarget PRIVATE Qt6::Multimedia) |
qmake: | QT += multimedia |
继承: | QObject |
virtual qsizetype | bufferSize () const = 0 |
virtual qsizetype | bytesFree () const = 0 |
virtual QAudio::Error | error () const = 0 |
virtual QAudioFormat | format () const = 0 |
virtual qint64 | processedUSecs () const = 0 |
virtual void | reset () = 0 |
virtual void | resume () = 0 |
virtual void | setBufferSize (qsizetype value ) = 0 |
virtual void | setFormat (const QAudioFormat & fmt ) = 0 |
virtual void | setVolume (qreal volume ) |
virtual void | start (QIODevice * device ) = 0 |
virtual QIODevice * | start () = 0 |
virtual QAudio::State | state () const = 0 |
virtual void | stop () = 0 |
virtual void | suspend () = 0 |
virtual qreal | volume () const |
void | errorChanged (QAudio::Error error ) |
void | stateChanged (QAudio::State state ) |
QPlatformAudioSink implements audio functionality for QAudioSink ,即: QAudioSink routes function calls to QPlatformAudioSink. For a description of the functionality that is implemented, see the QAudioSink class and function descriptions.
另请参阅 QAudioSink .
[signal]
void
QPlatformAudioSink::
errorChanged
(
QAudio::Error
error
)
此信号被发射当 error state has changed.
[signal]
void
QPlatformAudioSink::
stateChanged
(
QAudio::State
state
)
此信号被发射当设备 state 已改变。
[pure virtual]
qsizetype
QPlatformAudioSink::
bufferSize
() const
Returns the audio buffer size in bytes.
另请参阅 setBufferSize ().
[pure virtual]
qsizetype
QPlatformAudioSink::
bytesFree
() const
Returns the free space available in bytes in the audio buffer.
[pure virtual]
QAudio::Error
QPlatformAudioSink::
error
() const
返回错误状态。
[pure virtual]
QAudioFormat
QPlatformAudioSink::
format
() const
返回 QAudioFormat 被使用。
另请参阅 setFormat ().
[pure virtual]
qint64
QPlatformAudioSink::
processedUSecs
() const
Returns the amount of audio data processed since start () was called in milliseconds.
[pure virtual]
void
QPlatformAudioSink::
reset
()
Drops all audio data in the buffers, resets buffers to zero.
[pure virtual]
void
QPlatformAudioSink::
resume
()
Resumes processing audio data after a suspend ()
[pure virtual]
void
QPlatformAudioSink::
setBufferSize
(
qsizetype
value
)
Sets the audio buffer size to value in bytes.
另请参阅 bufferSize ().
[pure virtual]
void
QPlatformAudioSink::
setFormat
(const
QAudioFormat
&
fmt
)
设置 QAudioFormat to use to fmt . Setting the format is only allowable while in QAudio::StoppedState .
另请参阅 format ().
[虚拟]
void
QPlatformAudioSink::
setVolume
(
qreal
volume
)
Sets the volume. Where volume is between 0.0 and 1.0.
另请参阅 volume ().
[pure virtual]
void
QPlatformAudioSink::
start
(
QIODevice
*
device
)
使用 device 作为 QIODevice to transfer data.
[pure virtual]
QIODevice
*QPlatformAudioSink::
start
()
返回指针指向 QIODevice being used to handle the data transfer. This QIODevice can be used to write() audio data directly.
[pure virtual]
QAudio::State
QPlatformAudioSink::
state
() const
返回音频处理的状态。
[pure virtual]
void
QPlatformAudioSink::
stop
()
Stops the audio output.
[pure virtual]
void
QPlatformAudioSink::
suspend
()
Stops processing audio data, preserving buffered audio data.
[虚拟]
qreal
QPlatformAudioSink::
volume
() const
Returns the volume in the range 0.0 and 1.0.
另请参阅 setVolume ().