summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--resources/media/README.txt5
-rw-r--r--resources/media/callend.msczbin0 -> 4300 bytes
-rw-r--r--resources/media/callend.oggbin13932 -> 16655 bytes
-rw-r--r--resources/media/ring.oggbin66715 -> 79801 bytes
-rw-r--r--resources/media/ringback.msczbin0 -> 4358 bytes
-rw-r--r--resources/media/ringback.oggbin8352 -> 36061 bytes
-rw-r--r--resources/media/ringtone.msczbin0 -> 14417 bytes
-rw-r--r--src/voip/CallManager.cpp10
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
new file mode 100644
index 00000000..e77e7722
--- /dev/null
+++ b/resources/media/callend.mscz
Binary files differdiff --git a/resources/media/callend.ogg b/resources/media/callend.ogg
index 927ce1f6..f8188649 100644
--- a/resources/media/callend.ogg
+++ b/resources/media/callend.ogg
Binary files differdiff --git a/resources/media/ring.ogg b/resources/media/ring.ogg
index 708213bf..ac29e421 100644
--- a/resources/media/ring.ogg
+++ b/resources/media/ring.ogg
Binary files differdiff --git a/resources/media/ringback.mscz b/resources/media/ringback.mscz
new file mode 100644
index 00000000..d4d81ff6
--- /dev/null
+++ b/resources/media/ringback.mscz
Binary files differdiff --git a/resources/media/ringback.ogg b/resources/media/ringback.ogg
index 7dbfdcd0..4ae7c41f 100644
--- a/resources/media/ringback.ogg
+++ b/resources/media/ringback.ogg
Binary files differdiff --git a/resources/media/ringtone.mscz b/resources/media/ringtone.mscz
new file mode 100644
index 00000000..9e4e75db
--- /dev/null
+++ b/resources/media/ringtone.mscz
Binary files differdiff --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);