QAudioInput Class

The QAudioOutput class represents an input channel for audio. More...

Header: #include <QAudioInput>
CMake: find_package(Qt6 COMPONENTS Multimedia REQUIRED)
target_link_libraries(mytarget PRIVATE Qt6::Multimedia)
qmake: QT += multimedia
Inherits: QObject

Properties

Public Functions

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

Public Slots

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

Signals

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

Detailed Description

QAudioOutput represents an output channel that can be used together QMediaCaptureSession. It allows selecting the physical input device to be used, muting the channel or changing its volume.

Property Documentation

device : QAudioDevice

This property holds the audio device connected to this input.

The device property represents the audio device connected to this input. A default constructed QAudioInput object will be connected to the systems default audio input at construction time.

This property can be used to select any other output device listed by QMediaDevices::audioInputs().

Access functions:

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

Notifier signal:

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.

Access functions:

bool isMuted() const
void setMuted(bool muted)

Notifier signal:

void mutedChanged(bool muted)

volume : float

This property holds the current volume.

The volume is scaled linearly, ranging from 0 (silence) to 1 (full volume). Values outside this range will be clamped.

By default the volume is 1.

UI volume controls should usually be scaled nonlinearly. For example, using a logarithmic scale will produce linear changes in perceived loudness, which is what a user would normally expect from a volume control. See QAudio::convertVolume() for more details.

Access functions:

float volume() const
void setVolume(float volume)

Notifier signal:

void volumeChanged(float volume)