QPlatformAudioSource 类

QPlatformAudioSource 类提供访问为 QAudioSource 以访问由插件提供的音频设备。 更多...

头: #include <QPlatformAudioSource>
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 bytesReady () 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 start (QIODevice * device ) = 0
virtual QIODevice * start () = 0
virtual QAudio::State state () const = 0
virtual void stop () = 0
virtual void suspend () = 0

信号

void errorChanged (QAudio::Error error )
void stateChanged (QAudio::State state )

详细描述

QAudioDeviceInput keeps an instance of QPlatformAudioSource and routes calls to functions of the same name to QPlatformAudioSource. This means that it is QPlatformAudioSource that implements the audio functionality. For a description of the functionality, see the QAudioSource class description.

另请参阅 QAudioSource .

成员函数文档编制

[signal] void QPlatformAudioSource:: errorChanged ( QAudio::Error error )

此信号被发射当 error state has changed.

[signal] void QPlatformAudioSource:: stateChanged ( QAudio::State state )

此信号被发射当设备 state 已改变。

[pure virtual] qsizetype QPlatformAudioSource:: bufferSize () const

Returns the audio buffer size in milliseconds.

另请参阅 setBufferSize ().

[pure virtual] qsizetype QPlatformAudioSource:: bytesReady () const

Returns the amount of audio data available to read in bytes.

[pure virtual] QAudio::Error QPlatformAudioSource:: error () const

返回错误状态。

[pure virtual] QAudioFormat QPlatformAudioSource:: format () const

返回 QAudioFormat being used

另请参阅 setFormat ().

[pure virtual] qint64 QPlatformAudioSource:: processedUSecs () const

Returns the amount of audio data processed since start () was called in milliseconds.

[pure virtual] void QPlatformAudioSource:: reset ()

Drops all audio data in the buffers, resets buffers to zero.

[pure virtual] void QPlatformAudioSource:: resume ()

Resumes processing audio data after a suspend ().

[pure virtual] void QPlatformAudioSource:: setBufferSize ( qsizetype value )

Sets the audio buffer size to value in milliseconds.

另请参阅 bufferSize ().

[pure virtual] void QPlatformAudioSource:: setFormat (const QAudioFormat & fmt )

设置 QAudioFormat to use to fmt . Setting the format is only allowable while in QAudio::StoppedState .

另请参阅 format ().

[pure virtual] void QPlatformAudioSource:: start ( QIODevice * device )

使用 device 作为 QIODevice to transfer data.

[pure virtual] QIODevice *QPlatformAudioSource:: start ()

返回指针指向 QIODevice being used to handle the data transfer. This QIODevice can be used to read() audio data directly.

[pure virtual] QAudio::State QPlatformAudioSource:: state () const

返回音频处理的状态。

[pure virtual] void QPlatformAudioSource:: stop ()

Stops the audio input.

[pure virtual] void QPlatformAudioSource:: suspend ()

Stops processing audio data, preserving buffered audio data.