QAudioInput 类

表示音频的输入通道。 更多...

头: #include <QAudioInput>
CMake: find_package(Qt6 REQUIRED COMPONENTS Multimedia)
target_link_libraries(mytarget PRIVATE Qt6::Multimedia)
qmake: QT += multimedia
实例化: AudioInput
继承: QObject

特性

公共函数

QAudioDevice device () const
bool isMuted () const
float volume () const

公共槽

void setDevice (const QAudioDevice & device )
void setMuted (bool muted )
void setVolume (float volume )

信号

void deviceChanged ()
void mutedChanged (bool muted )
void volumeChanged (float volume )

详细描述

This class represents an input channel that can be used together with QMediaCaptureSession . It enables the selection of the physical input device to be used, muting the channel, and changing the channel's volume.

特性文档编制

device : QAudioDevice

This property holds the audio device connected to this input.

The device property represents the audio device connected to this input. This property can be used to select an input device from the QMediaDevices::audioInputs () list.

You can select the system default audio input by setting this property to a default constructed QAudioDevice 对象。

访问函数:

QAudioDevice device () const
void setDevice (const QAudioDevice & device )

通知程序信号:

void deviceChanged ()

muted : bool

This property holds the muted state of the current media.

The value will be true if the input is muted; otherwise false .

访问函数:

bool isMuted () const
void setMuted (bool muted )

通知程序信号:

void mutedChanged (bool muted )

volume : float

The property returns the volume of the audio input.

访问函数:

float volume () const
void setVolume (float volume )

通知程序信号:

void volumeChanged (float volume )