×

Discussion Board

Results 1 to 14 of 14
  1. #1
    Super Contributor
    Join Date
    Jul 2008
    Posts
    2,020

    Background music and sound FX for Qt/Maemo

    Hello Folks,
    I have to apologize in advance to all those annoyed by this question - I have been searching the forums like mad, but was not able to find a single result thanks to the new search engine.

    Does anyone have pointers to a way to implement a way to play wav files both as looping background music and as sound effects in Qt for Maemo-based games?

    With best regards
    Tam Hanna
    The lines above are the best I have to offer.If anyone of you is of more advanced knowledge, I ask for your patience and understanding! - unknown arab poet
    http://www.tamoggemon.com - Symbian blog - Windows Phone blog
    My other blogs:
    webOS blog iPhone blog BlackBerry blog Samsung bada blog Android blog

  2. #2
    Super Contributor
    Join Date
    Oct 2009
    Posts
    4,326

    Re: Background music and sound FX for Qt/Maemo

    For simple cases you use QSound
    http://doc.trolltech.com/4.6/qsound.html
    If you want to do something trickier then there is a Phonon
    http://doc.trolltech.com/4.6/phonon-...l#introduction

  3. #3
    Registered User
    Join Date
    Jun 2010
    Posts
    36

    Re: Background music and sound FX for Qt/Maemo

    For pure games you might consider SDL + OpenGL ES2 instead of Qt. Doom3, Quake4 and UT2004 were built on top of SDL for UNIX systems. Take a look at this: http://www.libsdl.org/intro.en/usingsound.html


    Best regards,
    Dorfmeister

  4. #4
    Super Contributor
    Join Date
    Mar 2009
    Posts
    1,024

    Re: Background music and sound FX for Qt/Maemo

    Quote Originally Posted by Dorfmeister View Post
    For pure games you might consider SDL + OpenGL ES2 instead of Qt. Doom3, Quake4 and UT2004 were built on top of SDL for UNIX systems. Take a look at this: http://www.libsdl.org/intro.en/usingsound.html

    Best regards,
    Dorfmeister
    I agree with Dorfmeister.. anyway It depends from the game type (Eg: a card game can be written in Qt without any problem) and about the platform you want to run the game... however is SDL supported by Symbian?
    Last edited by gnuton; 2010-06-16 at 10:49.

  5. #5
    Registered User
    Join Date
    Jun 2010
    Posts
    36

    Re: Background music and sound FX for Qt/Maemo


  6. #6
    Super Contributor
    Join Date
    Jul 2008
    Posts
    2,020

    Re: Background music and sound FX for Qt/Maemo

    Hi Folks,
    thank you so much for your response. The game is already written in Qt, so I can't move it to native anymore.

    I already had a "working" Phonon implementation, which unfortunately now compiles but doesn't make a beep. When running on my PR 1.2 N900, all I get is this output:

    Code:
    Lösche übriggebliebene Dateien vorangegangener Ausführungen...
    Löschen beendet.
    Dateien für Deployment: C:/Symbian/Carbide/workspace/QtBallZ\qtballz_0.1_armel.deb:
    Deployment beendet.
    Starte Anwendung.
    
    (Reading database ... 20305 files and directories currently installed.)
    
    Preparing to replace qtballz 0.1 (using qtballz_0.1_armel.deb) ...
    
    Unpacking replacement qtballz ...
    
    Setting up qtballz (0.1) ...
    
    "Warning: You do not seem to have the package gstreamer0.10-plugins-good installed.
              Some video features have been disabled."
    The code looks like this, and I have also set the application name:
    Code:
    /*
     * BallZPhononEngine.cpp
     *
     *  Created on: 25.01.2010
     *      Author: TAMHAN
     */
    
    #include "BallZPhononEngine.h"
    
    BallZPhononEngine::BallZPhononEngine()
    	{
    	configureMusic();
    
    	}
    
    BallZPhononEngine::~BallZPhononEngine()
    	{
    	destroyMusic();
    	}
    
    
    void BallZPhononEngine::configureMusic()
    {
    	bgm=Phonon::createPlayer(Phonon::MusicCategory,Phonon::MediaSource(":/sfx/rsc/music/bgm.wav"));
    	bgm->setTransitionTime(-500);
    	bgm->enqueue(Phonon::MediaSource(":/sfx/rsc/music/bgm.wav"));
    	connect(bgm,SIGNAL(aboutToFinish()),this,SLOT(playMusic()));
    
    
    	playMusic();
    
    	lrgboom=Phonon::createPlayer(Phonon::MusicCategory,Phonon::MediaSource(":/sfx/rsc/music/lrgboom.wav"));
    	midboom=Phonon::createPlayer(Phonon::MusicCategory,Phonon::MediaSource(":/sfx/rsc/music/midboom.wav"));
    	smlboom=Phonon::createPlayer(Phonon::MusicCategory,Phonon::MediaSource(":/sfx/rsc/music/smlboom.wav"));
    	lrgboom->play();
    }
    
    void BallZPhononEngine::destroyMusic()
    {
    	bgm->clear();
    	lrgboom->clear();
    	midboom->clear();
    	smlboom->clear();
    
    	delete bgm;
    	delete lrgboom;
    	delete midboom;
    	delete smlboom;
    }
    
    void BallZPhononEngine::playSmlBoom()
    {
    	smlboom->play();
    }
    
    void BallZPhononEngine::playMidBoom()
    {
    	midboom->play();
    }
    
    void BallZPhononEngine::playLrgBoom()
    {
    	lrgboom->play();
    }
    
    void BallZPhononEngine::playMusic()
    {
    	bgm->stop();
    	bgm->play();
    }
    The strange thing is that it worked on Symbian, but doesnt work on Maemo. The N900 is not muted AFAIK, BTW.

    Ideas, anyone?
    The lines above are the best I have to offer.If anyone of you is of more advanced knowledge, I ask for your patience and understanding! - unknown arab poet
    http://www.tamoggemon.com - Symbian blog - Windows Phone blog
    My other blogs:
    webOS blog iPhone blog BlackBerry blog Samsung bada blog Android blog

  7. #7
    Super Contributor
    Join Date
    Oct 2009
    Posts
    4,326

    Re: Background music and sound FX for Qt/Maemo

    Quote Originally Posted by tamhanna View Post
    "Warning: You do not seem to have the package gstreamer0.10-plugins-good installed.
    Some video features have been disabled."
    Do you have GStreamer plugins installed?
    Code:
    dpkg -l "*gstreamer*plugins*" | grep ii
    ii  gstreamer0.10-plugins-bad             0.10.14-git265-0maemo10+0m5           GStreamer plugins from the "bad" set
    ii  gstreamer0.10-plugins-base            0.10.25-0maemo14+0m5                  GStreamer plugins from the "base" set
    ii  gstreamer0.10-plugins-base-extra      0.10.25-0maemo14+0m5                  Extra GStreamer plugins from the "base" set
    ii  gstreamer0.10-plugins-camera          0.79-1+0m5                            GStreamer plugins for camera application
    ii  gstreamer0.10-plugins-camera-apps     0.79-1+0m5                            GStreamer plugins for camera application
    ii  gstreamer0.10-plugins-good            0.10.16-git276-0maemo18+0m5           GStreamer plugins from the "good" set
    ii  gstreamer0.10-plugins-good-extra      0.10.16-git276-0maemo18+0m5           Collection of various GStreamer plugins
    ii  libgstreamer-plugins-base0.10-0       0.10.25-0maemo14+0m5                  GStreamer libraries from the "base" set

  8. #8
    Super Contributor
    Join Date
    Jul 2008
    Posts
    2,020

    Re: Background music and sound FX for Qt/Maemo

    Hi divanov,
    not sure, sorry. How can I check this?

    I am not very experienced with Maemo. But I am now worried: if I have to install gstreamer manually, how can I get this done on my customers handsets also?

    With best regards
    Tam Hanna
    The lines above are the best I have to offer.If anyone of you is of more advanced knowledge, I ask for your patience and understanding! - unknown arab poet
    http://www.tamoggemon.com - Symbian blog - Windows Phone blog
    My other blogs:
    webOS blog iPhone blog BlackBerry blog Samsung bada blog Android blog

  9. #9
    Super Contributor
    Join Date
    Oct 2009
    Posts
    4,326

    Re: Background music and sound FX for Qt/Maemo

    Quote Originally Posted by tamhanna View Post
    How can I check this?
    By executing dpkg -l "*gstreamer*plugins*" in XTerminal?

    Quote Originally Posted by tamhanna View Post
    But I am now worried: if I have to install gstreamer manually, how can I get this done on my customers handsets also?
    In principle I do not believe that some important plugins are not part of firmware. But you always can include extra packages as a dependencies for your application to make apt install it automatically.

  10. #10
    Super Contributor
    Join Date
    Jul 2008
    Posts
    2,020

    Re: Background music and sound FX for Qt/Maemo

    Hi Danil,
    thank you so much for talking back!

    I have now ran the command, and all I get is a list of packages.

    All the best
    Tam Hanna

    P.S. I am using the stock N900 1.2 firmware!
    The lines above are the best I have to offer.If anyone of you is of more advanced knowledge, I ask for your patience and understanding! - unknown arab poet
    http://www.tamoggemon.com - Symbian blog - Windows Phone blog
    My other blogs:
    webOS blog iPhone blog BlackBerry blog Samsung bada blog Android blog

  11. #11
    Super Contributor
    Join Date
    Oct 2009
    Posts
    4,326

    Re: Background music and sound FX for Qt/Maemo

    Quote Originally Posted by tamhanna View Post
    I have now ran the command, and all I get is a list of packages.
    That's what dpkg -l results in...
    You may consider providing small test application I can investigate.
    Last edited by divanov; 2010-06-17 at 12:24.

  12. #12
    Super Contributor
    Join Date
    Jul 2008
    Posts
    2,020

    Re: Background music and sound FX for Qt/Maemo

    Hi,
    I will provide one shortly.

    In the meantime: my files are contained in resources. Could that be the problem?

    What I have seen, QSound doesn't do resources...
    The lines above are the best I have to offer.If anyone of you is of more advanced knowledge, I ask for your patience and understanding! - unknown arab poet
    http://www.tamoggemon.com - Symbian blog - Windows Phone blog
    My other blogs:
    webOS blog iPhone blog BlackBerry blog Samsung bada blog Android blog

  13. #13
    Super Contributor
    Join Date
    Oct 2009
    Posts
    4,326

    Re: Background music and sound FX for Qt/Maemo

    Quote Originally Posted by tamhanna View Post
    In the meantime: my files are contained in resources. Could that be the problem?
    It could. It was working in Qt 4.5.3 and not working any more in Qt 4.6. Somewhere here was a thread about it:
    http://discussion.forum.nokia.com/fo...urces-question
    it doesn't work on Symbian as well.

  14. #14
    Super Contributor
    Join Date
    Jul 2008
    Posts
    2,020

    Re: Background music and sound FX for Qt/Maemo

    Hi,
    I now moved the files elsewhere, and the playback works - so Phonon and resources is a nogo.

    However, I did not get much farther. I want the music to loop, but it stutters like hell. How can I get it to do "gapless" playback?

    Tam
    The lines above are the best I have to offer.If anyone of you is of more advanced knowledge, I ask for your patience and understanding! - unknown arab poet
    http://www.tamoggemon.com - Symbian blog - Windows Phone blog
    My other blogs:
    webOS blog iPhone blog BlackBerry blog Samsung bada blog Android blog

Similar Threads

  1. Qt for Maemo and Qt for embedde Linux
    By Estel in forum Nokia N9
    Replies: 2
    Last Post: 2010-03-21, 21:34
  2. Replies: 11
    Last Post: 2010-01-26, 19:00
  3. Replies: 0
    Last Post: 2009-11-18, 12:18
  4. Qt for maemo presentation in Qt dev days
    By Jack Torrance in forum Nokia N9
    Replies: 1
    Last Post: 2009-10-17, 08:10

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×