Qt World Summit: Submit your Presentation

Cannot use WebRTC AudioCapture with WebEngineView connected to local server via WebKitSpeechRecognition

  • Hello. I am having trouble getting a WebEngineView to convert speech to text using the SpeechRecognition API.
    if I access the same page from chrome, the URL is able to correctly recognize speech, but in the Qt Web Engine View, it doesn't even appear to be accessing the microphone.

    This is on Qt 5.15.0 on Kubuntu (lastest). Other Qt components are able to detect and use the microphone, however the WebEngineView cannot. No errors are returned and under closer inspection of the Qt 5.15.0 source code, it seems to be setting the feature to -1 by default with Q_UNREACHABLE() before it.. not sure what this implies or if its relevant but..

    (From Qt 5.15 Source)

    static QQuickWebEngineView::Feature toFeature(QtWebEngineCore::ProfileAdapter::PermissionType type)
        switch (type) {
        case QtWebEngineCore::ProfileAdapter::NotificationPermission:
            return QQuickWebEngineView::Notifications;
        case QtWebEngineCore::ProfileAdapter::GeolocationPermission:
            return QQuickWebEngineView::Geolocation;
        return QQuickWebEngineView::Feature(-1);
    void QQuickWebEngineViewPrivate::runFeaturePermissionRequest(QtWebEngineCore::ProfileAdapter::PermissionType permission, const QUrl &url)
        Q_EMIT q->featurePermissionRequested(url, toFeature(permission));


    import QtQuick 2.15
    import QtQuick.Window 2.15
    import QtWebEngine 1.10
    Window {
        visible: true
        width: 640
        height: 480
        title: qsTr("Hello World")
        WebEngineView {
            id: view
            anchors.fill: parent
            url: ""
            audioMuted: false
            onLoadingChanged: {
                if (!view.loading) {
                    console.log("Requesting audio capture")
                   // featurePermissionRequested(url, WebEngineView.MediaAudioCapture)
            onFeaturePermissionRequested: {
                view.grantFeaturePermission(securityOrigin, feature, true)
            Component.onCompleted: {


    window.rc = new webkitSpeechRecognition()
    window.rc.onresult = function(result) {