Qt音频引擎不在Ubuntu SDK中

我使用的是Ubuntu 14.04。 我使用Ubuntu网站上的说明安装了Ubuntu SDK没有问题。 我创建了一个新的QML项目。 我想创建一个使用Qt Audio Engine的应用程序。 这是我在测试音频引擎的代码:

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" } } } 

当我尝试运行程序时,出现错误:未安装模块“QtAudioEngine”。

Qt Audio Engine在当前的Ubuntu QML API中。 为什么不在SDK中? 我应该以某种方式自己安装它还是由开发团队添加?

我使用了这个代码的修改版本(对标签的小改动)来测试缺少的内容:

 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" } } } 

您基本上需要为Desktop目标安装以下包:

 sudo apt-get install qtdeclarative5-qtaudioengine-plugin 

对于Ubuntu Touch:

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

最后你可以用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.