diff options
author | Nicolas Werner <nicolas.werner@hotmail.de> | 2023-11-09 21:32:19 +0100 |
---|---|---|
committer | Nicolas Werner <nicolas.werner@hotmail.de> | 2023-11-09 21:32:19 +0100 |
commit | 0e0a93914e736604238e1dbfd226558f4fcadf92 (patch) | |
tree | 3eb92bc4ea96c4d2b6791ba9de814763821c5ab6 | |
parent | 31aebb33ae95557b1b8c0e746d7bb7c7e1ed0592 (diff) |
Replace mediafiles
fixes #1590
-rw-r--r-- | resources/media/README.txt | 5 | ||||
-rw-r--r-- | resources/media/callend.mscz | bin | 0 -> 4300 bytes | |||
-rw-r--r-- | resources/media/callend.ogg | bin | 13932 -> 16655 bytes | |||
-rw-r--r-- | resources/media/ring.ogg | bin | 66715 -> 79801 bytes | |||
-rw-r--r-- | resources/media/ringback.mscz | bin | 0 -> 4358 bytes | |||
-rw-r--r-- | resources/media/ringback.ogg | bin | 8352 -> 36061 bytes | |||
-rw-r--r-- | resources/media/ringtone.mscz | bin | 0 -> 14417 bytes | |||
-rw-r--r-- | src/voip/CallManager.cpp | 10 |
8 files changed, 7 insertions, 8 deletions
diff --git a/resources/media/README.txt b/resources/media/README.txt deleted file mode 100644 index ce1e5933..00000000 --- a/resources/media/README.txt +++ /dev/null @@ -1,5 +0,0 @@ -The below media files were obtained from https://github.com/matrix-org/matrix-react-sdk/tree/develop/res/media - -callend.ogg -ringback.ogg -ring.ogg diff --git a/resources/media/callend.mscz b/resources/media/callend.mscz Binary files differnew file mode 100644 index 00000000..e77e7722 --- /dev/null +++ b/resources/media/callend.mscz diff --git a/resources/media/callend.ogg b/resources/media/callend.ogg Binary files differindex 927ce1f6..f8188649 100644 --- a/resources/media/callend.ogg +++ b/resources/media/callend.ogg diff --git a/resources/media/ring.ogg b/resources/media/ring.ogg Binary files differindex 708213bf..ac29e421 100644 --- a/resources/media/ring.ogg +++ b/resources/media/ring.ogg diff --git a/resources/media/ringback.mscz b/resources/media/ringback.mscz Binary files differnew file mode 100644 index 00000000..d4d81ff6 --- /dev/null +++ b/resources/media/ringback.mscz diff --git a/resources/media/ringback.ogg b/resources/media/ringback.ogg Binary files differindex 7dbfdcd0..4ae7c41f 100644 --- a/resources/media/ringback.ogg +++ b/resources/media/ringback.ogg diff --git a/resources/media/ringtone.mscz b/resources/media/ringtone.mscz Binary files differnew file mode 100644 index 00000000..9e4e75db --- /dev/null +++ b/resources/media/ringtone.mscz diff --git a/src/voip/CallManager.cpp b/src/voip/CallManager.cpp index 46679e71..d31592bf 100644 --- a/src/voip/CallManager.cpp +++ b/src/voip/CallManager.cpp @@ -7,8 +7,8 @@ #include <chrono> #include <cstdint> #include <cstdlib> -#include <memory> +#include <QAudioOutput> #include <QGuiApplication> #include <QUrl> @@ -186,10 +186,13 @@ CallManager::CallManager(QObject *parent) connect( &CallDevices::instance(), &CallDevices::devicesChanged, this, &CallManager::devicesChanged); + auto audioOutput = new QAudioOutput(&player_); + player_.setAudioOutput(audioOutput); + connect( &player_, &QMediaPlayer::mediaStatusChanged, this, [this](QMediaPlayer::MediaStatus status) { - if (status == QMediaPlayer::LoadedMedia) - player_.play(); + nhlog::ui()->debug("WebRTC: ringtone status {}", + QMetaEnum::fromType<QMediaPlayer::MediaStatus>().valueToKey(status)); }); connect(&player_, @@ -841,6 +844,7 @@ CallManager::retrieveTurnServer() void CallManager::playRingtone(const QUrl &ringtone, bool repeat) { + nhlog::ui()->debug("Trying to play ringtone {}", ringtone.toString().toStdString()); player_.setLoops(repeat ? QMediaPlayer::Infinite : 1); player_.setSource(ringtone); // player_.audioOutput()->setVolume(100); |