GNU/Linux >> Tutoriels Linux >  >> Ubuntu

Le moteur audio Qt n'est pas dans le Sdk Ubuntu ?

J'utilise Ubuntu 14.04. J'ai installé le SDK Ubuntu sans problème en suivant les instructions sur le site Web d'Ubuntu. J'ai créé un nouveau projet QML. Je veux créer une application qui utilise Qt Audio Engine. Voici mon code où je teste le moteur audio :

import QtQuick 2.0
import Ubuntu.Components 0.1
import QtAudioEngine 1.0
import "ui"

MainView {
// objectName for functional testing purposes (autopilot-qt5)
objectName: "mainView"

// Note! applicationName needs to match the "name" field of the click manifest
applicationName: "com.ubuntu.developer..AudioEngineTest"

/*
 This property enables the application to change orientation
 when the device is rotated. The default is false.
*/
//automaticOrientation: true

width: units.gu(100)
height: units.gu(75)

AudioEngine {

}

Tabs {
    id: tabs

    HelloTab {
        objectName: "helloTab"
    }

    WorldTab {
        objectName: "worldTab"
    }
}
}

Lorsque j'essaie d'exécuter le programme, une erreur s'affiche :le module "QtAudioEngine" n'est pas installé.

Le moteur audio Qt se trouve dans l'API Ubuntu QML actuelle. Pourquoi n'est-il pas dans le SDK ? Dois-je l'installer moi-même ou sera-t-il ajouté par l'équipe de développement ?

Réponse acceptée :

J'ai utilisé cette version modifiée de votre code (petites modifications des onglets) pour tester ce qui manquait :

import QtQuick 2.0
import Ubuntu.Components 0.1
import QtAudioEngine 1.0
import "ui"

MainView {
    // objectName for functional testing purposes (autopilot-qt5)
    objectName: "mainView"

    // Note! applicationName needs to match the "name" field of the click manifest
    applicationName: "com.ubuntu.developer.AudioEngineTest"

    /*
     This property enables the application to change orientation
     when the device is rotated. The default is false.
    */
    //automaticOrientation: true

    width: units.gu(100)
    height: units.gu(75)

    AudioEngine {

    }

    Tabs {
        id: tabs

        Tab {
            title: "helloTab"
        }

        Tab {
            title: "worldTab"
        }
    }
}

Vous devez essentiellement installer le package suivant pour une cible Desktop :

sudo apt-get install qtdeclarative5-qtaudioengine-plugin

Pour Ubuntu Touch :

sudo apt-get install qtdeclarative5-qtaudioengine-touch-plugin

Enfin vous pouvez le tester avec qmlscene :

$ qmlscene ./audio.qml
Module 'QtAudioEngine' does not contain a module identifier directive - it cannot be protected from external registrations.
unity::action::ActionManager::ActionManager(QObject*):
    Could not determine application identifier. HUD will not work properly.
    Provide your application identifier in $APP_ID environment variable.
default openal device =  OpenAL Soft 
device list: 
     OpenAL Soft 
AudioEngine begin initialization 
creating default category 
init samples 0 
init sounds 0 
AudioEngine ready. 

Ubuntu
  1. Ubuntu 17.10 - La souris ne s'affiche pas dans Xinput ?

  2. Bluetooth ne fonctionne pas sur Ubuntu 20 Rapsberry Pi ?

  3. Ubuntu 14.04 Libreoffice ne s'ouvre pas ?

  4. Bluetooth ne fonctionne pas sur Ubuntu 13.10 ?

  5. Comment mettre à jour Pulseaudio vers 12.x dans Ubuntu 18.04 ?

Comment installer le SDK Google Cloud sur Ubuntu 20.04

Comment configurer .Net Core dans Ubuntu 20.04

Comment installer Audacity Audio Editor sur Ubuntu 20.04

Installer le SDK Google Cloud sur Ubuntu 20.04

Audacity d'installation d'Ubuntu (installation en 1 clic)

La commande Traceroute ne fonctionne pas sur Ubuntu