JS8Call-Improved master
Loading...
Searching...
No Matches
SoundInput Class Reference

Gets audio data from a QAudioSource and passes frames to a sink. More...

#include <SoundInput.h>

Inheritance diagram for SoundInput:
Collaboration diagram for SoundInput:

Public Member Functions

 SoundInput (QObject *parent=nullptr)
 Construct a SoundInput helper.
 ~SoundInput ()
 Destroy the SoundInput and release resources.
Q_SLOT void start (QAudioDevice const &device, int framesPerBuffer, AudioDevice *sink, AudioDevice::Channel channel=AudioDevice::Mono)
 Start capturing audio and forward it to sink.
Q_SLOT void suspend ()
 Temporarily suspend audio capture without dropping the stream.
Q_SLOT void resume ()
 Resume a previously suspended capture session.
Q_SLOT void stop ()
 Stop audio capture and release the configured sink.
Q_SIGNAL void error (QString message) const
 Emitted when a non-fatal error occurs during capture.
Q_SIGNAL void status (QString message) const
 Emitted to report status messages from the capture helper.

Detailed Description

Gets audio data from a QAudioSource and passes frames to a sink.

The sink must outlive the active capture session. Start/stop/suspend operations control the underlying QAudioSource stream.

Constructor & Destructor Documentation

◆ SoundInput()

SoundInput::SoundInput ( QObject * parent = nullptr)
inline

Construct a SoundInput helper.

Parameters
parentOptional parent QObject.

◆ ~SoundInput()

SoundInput::~SoundInput ( )

Destroy the SoundInput and release resources.

Destructs the SoundInput object.

Here is the call graph for this function:

Member Function Documentation

◆ error()

Q_SIGNAL void SoundInput::error ( QString message) const

Emitted when a non-fatal error occurs during capture.

Parameters
messageHuman-readable error description.
Here is the caller graph for this function:

◆ resume()

void SoundInput::resume ( )

Resume a previously suspended capture session.

Resumes audio input.

Here is the caller graph for this function:

◆ start()

void SoundInput::start ( QAudioDevice const & device,
int framesPerBuffer,
AudioDevice * sink,
AudioDevice::Channel channel = AudioDevice::Mono )

Start capturing audio and forward it to sink.

Starts audio input from the specified device.

Parameters
deviceInput audio device to use.
framesPerBufferNumber of frames to request per buffer.
sinkDestination AudioDevice to receive frames. Must outlive capture.
channelChannel selection for the sink (default: Mono).
deviceThe QAudioDevice to use for input.
framesPerBufferThe number of frames per buffer.
sinkThe AudioDevice sink to write audio data to.
channelThe audio channel configuration (Mono or Stereo).
Here is the call graph for this function:
Here is the caller graph for this function:

◆ status()

Q_SIGNAL void SoundInput::status ( QString message) const

Emitted to report status messages from the capture helper.

Parameters
messageInformational text.

◆ stop()

void SoundInput::stop ( )

Stop audio capture and release the configured sink.

Stops audio input.

Here is the caller graph for this function:

◆ suspend()

void SoundInput::suspend ( )

Temporarily suspend audio capture without dropping the stream.

Suspends audio input.

Here is the caller graph for this function:

The documentation for this class was generated from the following files: