Plays short notification sounds using an internal output stream.
More...
#include <NotificationAudio.h>
|
| void | status (QString message) |
| | Relay a status message from internal components.
|
| void | error (QString message) |
| | Relay an error message from internal components.
|
| void | setDevice (const QAudioDevice &device, unsigned msBuffer=0) |
| | Set output device and optional buffering for playback.
|
| void | play (const QString &filePath) |
| | Play a sound file referenced by filePath.
|
| void | stop () |
| | Stop any currently playing notification sound.
|
Plays short notification sounds using an internal output stream.
The class maintains an in-memory cache of decoded PCM audio so that frequently used notification sounds play with minimal latency.
◆ NotificationAudio()
| NotificationAudio::NotificationAudio |
( |
QObject * | parent = nullptr | ) |
|
|
explicit |
◆ ~NotificationAudio()
| NotificationAudio::~NotificationAudio |
( |
| ) |
|
◆ error
| void NotificationAudio::error |
( |
QString | message | ) |
|
|
slot |
Relay an error message from internal components.
Handles error messages from the SoundOutput.
- Parameters
-
| message | Error description. |
| message | The error message. |
◆ play
| void NotificationAudio::play |
( |
const QString & | filePath | ) |
|
|
slot |
Play a sound file referenced by filePath.
Plays an audio file from the specified file path.
- Parameters
-
| filePath | Path to an audio resource on disk. |
| filePath | The path to the audio file. |
◆ setDevice
| void NotificationAudio::setDevice |
( |
const QAudioDevice & | device, |
|
|
unsigned | msBuffer = 0 ) |
|
slot |
Set output device and optional buffering for playback.
Sets the audio device and buffer size.
- Parameters
-
| device | Audio output device to use. |
| msBuffer | Milliseconds of buffer to allocate for playback. |
| device | The QAudioDevice to use. |
| msBuffer | The buffer size in milliseconds. |
◆ status
| void NotificationAudio::status |
( |
QString | message | ) |
|
|
slot |
Relay a status message from internal components.
Handles status messages from the SoundOutput.
- Parameters
-
| message | Informational text. |
| message | The status message. |
◆ stop
| void NotificationAudio::stop |
( |
| ) |
|
|
slot |
Stop any currently playing notification sound.
Stops audio playback.
The documentation for this class was generated from the following files: