17class NotificationSoundOutput :
public QObject
22 explicit NotificationSoundOutput(QObject *parent =
nullptr);
23 ~NotificationSoundOutput()
override;
25 void setDevice(QAudioDevice
const &device,
unsigned msBuffer);
27 void play(QByteArray
const &data, QAudioFormat
const &format);
31 void status(QString message);
32 void error(QString message);
35 void handleStateChanged(QAudio::State newState);
40 QAudioDevice m_device;
41 std::unique_ptr<QAudioSink> m_sink;
42 std::unique_ptr<QBuffer> m_buffer;
43 QAudioFormat m_currentFormat;
45 unsigned m_msBuffer = 0;
void setAttenuation(qreal a)
Sets the attenuation in dB.
Definition NotificationSoundOutput.cpp:44
void play(QByteArray const &data, QAudioFormat const &format)
Plays audio from the provided data and format.
Definition NotificationSoundOutput.cpp:60
void stop()
Stops playback and releases all resources.
Definition NotificationSoundOutput.cpp:133
void setDevice(QAudioDevice const &device, unsigned msBuffer)
Sets the audio device and buffer size.
Definition NotificationSoundOutput.cpp:33