Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Developer
Posts: 51
Registered: ‎06-13-2011
My Device: Bold 9900, PlayBook 64GB, Dev Alpha
My Carrier: Bell Mobility

Error building when using SystemSound from bb.multimedia

I am trying to add a little sound to my app, using the SystemSound class - https://developer.blackberry.com/cascades/reference/bb__multimedia__systemsound.html

 

I am using code similar to what is on the above linked page for QML use of this class:

 

import bb.multimedia 1.0 
... 
attachedObjects: [ 
SystemSound { 
id: sound 
sound: SystemSound.SoundCameraShutterEvent 
} 
] 
... 
onClicked: { 
sound.play(); 
}

 But when I build I get the following errors and can't launch my app:

 

NavigatorPrivate::NavigatorPrivate - width=768
NavigatorPrivate::NavigatorPrivate - height=1280
NavigatorPrivate::NavigatorPrivate - angle=0

### TIMESTAMP pid=45314250 at 377594078 ms -> "server thread started"
### Server Thread: STARTED
startScreenEventThread(SUCCESS)
### PPS Thread: STARTED (10)
ERROR:: QNXPpsSubscriptionServer: QNXPpsSubscriptionServer::createObject: (13) Failed to create dir /pps/services/automation/framework

ERROR:: QNXPpsSubscriptionServer: QNXPpsSubscriptionServer::subscribe: Failed to open /pps/services/automation/framework/control?delta,notify=808:00000001

bb::cascades::QmlDocument: error when loading QML from:   QUrl( "file:///accounts/1000/appdata/com.example.SignalsSlotsTutorial.testDev_otsTutorialbb2f1b19/app/native/assets/main.qml" )  
  --- errors:  (file:///accounts/1000/appdata/com.example.SignalsSlotsTutorial.testDev_otsTutorialbb2f1b19/app/native/assets/main.qml:17:1: module "bb.multimedia" is not installed
    import bb.multimedia 1.0  
    ^) 
QmlDocument:createRootNode document is not loaded or has errors, can't create root 

 

Looks to be an error related to loading the bb.multimedia module to enable my use of SystemSound. I see the multimedia module in my project file with the other modules at:

Includes>D:/bbndk/target_10_0_6_384/qnx6/usr/include>bb>multimedia>SystemSound.hpp

 

I see on the release notes for this Beta2 it says:

 

The multimedia APIs currently require a set of libraries to be linked in the application project (.pro file). The libraries required are: –lbbmultimedia –lmmrndclient –lstrm –lasound. 

I have not done this linking as described in the release notes - perhaps this is the cause of my error? What should I add to the .pro file to link these libraries?

 

Thanks! 

 

Developer
Posts: 51
Registered: ‎06-13-2011
My Device: Bold 9900, PlayBook 64GB, Dev Alpha
My Carrier: Bell Mobility

Re: Error building when using SystemSound from bb.multimedia

Ok I think I properly updated my .pro file to link to those libraries, but still getting same error on launch. The code I used to link those libs:

LIBS += -lbbmultimedia -lmmrndclient -lstrm -lasound
BlackBerry Development Advisor (Retired)
Posts: 499
Registered: ‎05-07-2012
My Device: developer
My Carrier: developer

Re: Error building when using SystemSound from bb.multimedia

[ Edited ]

Photobomber has:

  import bb.cascades.multimedia 1.0

If  I change it to:

  import bb.multimedia 1.0

I get:

 

bb::cascades::QmlDocument: error when loading QML from:   QUrl( "file:///accounts/1000/appdata/com.example.photobomber.testDev_photobomber5595ad10/app/native/assets/main.qml" )  
  --- errors:  (file:///accounts/1000/appdata/com.example.photobomber.testDev_photobomber5595ad10/app/native/assets/main.qml:24:1: module "bb.multimedia" is not installed
    import bb.multimedia 1.0
    ^)

Stuart

Developer
Posts: 201
Registered: ‎05-08-2012
My Device: PlayBook 64 Gb and Z10 LE
My Carrier: Vodafone

Re: Error building when using SystemSound from bb.multimedia

I too have this problem .. I tried to change the file. pros but nothing to do

_______________________________________________

If U like my post click on LIKE :smileywink:
Contributor
Posts: 15
Registered: ‎08-14-2012
My Device: Blackberry Dev Alpha - Blackberry Playbook
My Carrier: Vodafone

Re: Error building when using SystemSound from bb.multimedia

Idem for me!

Developer
Posts: 201
Registered: ‎05-08-2012
My Device: PlayBook 64 Gb and Z10 LE
My Carrier: Vodafone

Re: Error building when using SystemSound from bb.multimedia

There is another way to control the volume of the device with a slider?

_______________________________________________

If U like my post click on LIKE :smileywink:
Developer
Posts: 201
Registered: ‎05-08-2012
My Device: PlayBook 64 Gb and Z10 LE
My Carrier: Vodafone

Re: Error building when using SystemSound from bb.multimedia

i find a solution ..

 

in .cpp file insert this ..

 

#include <bb/cascades/multimedia/Camera>

;

 

using namespace bb::cascades::multimedia;

_______________________________________________

If U like my post click on LIKE :smileywink:
Developer
Posts: 107
Registered: ‎05-11-2011
My Device: BlackBerry Z10 LE
My Carrier: AirTel

Re: Error building when using SystemSound from bb.multimedia

Hi ,

 

Code for you.

 

this line require in .pro file LIBS += -lbbmultimedia -lmmrndclient -lstrm -lasound .

 

CPP

 

#include <QObject>

#include <bb/multimedia/SystemSound.hpp>

#include <bb/cascades/Application>
#include <bb/cascades/QmlDocument>
#include <bb/cascades/AbstractPane>

using namespace bb::cascades;
using namespace bb::multimedia;

App::App() {

    qmlRegisterType<SystemSound>("bb.multimedia", 1, 0, "SystemSound");
    QmlDocument *qml = QmlDocument::create("main.qml");
    AbstractPane *root = qml->createRootNode<AbstractPane>();

    Application::setScene(root);
}

 

You have to put this 

qmlRegisterType<SystemSound>("bb.multimedia", 1, 0, "SystemSound");

before you create QmlDocument.

 

QML

 

import bb.cascades 1.0
import bb.multimedia 1.0

Page {
    content: Container {
        Button {
            text: "Button"
            attachedObjects: [
                SystemSound {
                    id: sound
                    sound: SystemSound.SoundCameraShutterEvent
                }
            ]
            onClicked: {
                sound.play();
            }
        }
    }
}

 

 

 

if you like my answer click on like.

BlackBerry Development Advisor (Retired)
Posts: 499
Registered: ‎05-07-2012
My Device: developer
My Carrier: developer

Re: Error building when using SystemSound from bb.multimedia

There seem to be multiple questions on this thread.

Perhaps my original reply was unclear.   The import is wrong.

 

willrobinson: do you have additional questions?

 

Are there additional open questions on this thread topic?

 

Stuart

Developer
Posts: 322
Registered: ‎05-07-2009
My Device: BlackBerry Z10, PlayBook, 9900
My Carrier: Telus

Re: Error building when using SystemSound from bb.multimedia

At the risk of adding more confusion... what is the final solution to this?

 

I too get the error regardless of the import used.

 

import bb.cascades.multimedia 1.0

 

or

 

import bb.multimedia 1.0

 

Cheers,

Steve


PlayBook Apps: DataMine, Dots + Boxes, 5 Marbles
BlackBerry SmartPhone Apps: 5 Marbles Soon: **** (D.Z.A), ****Quest, **** Challenge, VaultCracker, DevBrowser, Radial****