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 Binary files /dev/null and b/resources/media/callend.mscz differ diff --git a/resources/media/callend.ogg b/resources/media/callend.ogg index 927ce1f6..f8188649 100644 Binary files a/resources/media/callend.ogg and b/resources/media/callend.ogg differ diff --git a/resources/media/ring.ogg b/resources/media/ring.ogg index 708213bf..ac29e421 100644 Binary files a/resources/media/ring.ogg and b/resources/media/ring.ogg differ diff --git a/resources/media/ringback.mscz b/resources/media/ringback.mscz new file mode 100644 index 00000000..d4d81ff6 Binary files /dev/null and b/resources/media/ringback.mscz differ diff --git a/resources/media/ringback.ogg b/resources/media/ringback.ogg index 7dbfdcd0..4ae7c41f 100644 Binary files a/resources/media/ringback.ogg and b/resources/media/ringback.ogg differ diff --git a/resources/media/ringtone.mscz b/resources/media/ringtone.mscz new file mode 100644 index 00000000..9e4e75db Binary files /dev/null and b/resources/media/ringtone.mscz differ 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 #include #include -#include +#include #include #include @@ -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().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);