×

Discussion Board

Results 1 to 10 of 10
  1. #1
    Regular Contributor
    Join Date
    Feb 2006
    Posts
    67

    Best practice / standard ways for cross platform sound suitable for games

    Hi

    I'm busy with a game project for Qt. At the moment it is targeting symbian but I would like to remain flexible and be able to port it to the Meego device when it launches and maybe the N900. I've searched quite a lot around sound playing in Qt but can't find any definitive answers / best practices for sound suitable for gaming - sincere apologies if I have just not seen these answers

    My requirements are specifically:

    * Background music through mp3 or other compressed format
    * Sound effects either wav or compressed format
    * Mixing simultaneous sound effects
    * Giving each effect a stereo offset and volume - for example sounds on the left side of the screen play louder through the left headphone / speaker etc
    * Pitch / speed shifting of sounds, for example on a gunfire sound to prevent it becoming too monotonous.
    * Low latency on sound effects

    I've had a look at QtMobility, Phonon, and QSound, but none of them seem to support stereo offset or pitch changing that I can see, and the information on mixing, buffering, performance etc is spotty at best. I also saw a custom symbian solution at http://tamss60.tamoggemon.com/2010/0...t-for-symbian/ but would really like to do this all in Qt if possible for portability. I would imagine what I'm wanting to do is pretty standard for any game - I've done the same before on various other APIs.


    Your help is appreciated!

    Dave

  2. #2
    Regular Contributor
    Join Date
    Feb 2006
    Posts
    67

    Re: Best practice / standard ways for cross platform sound suitable for games

    Hi everyone

    If this is currently not possible, I would very much appreciate if someone can just answer that it is impossible and why, so I know and can safely move on to other solutions.


    Thanks

    Dave

  3. #3
    Regular Contributor
    Join Date
    May 2010
    Posts
    362

    Re: Best practice / standard ways for cross platform sound suitable for games

    The delay when playing sound effects is still present on Symbian^3 devices.

    For game sound support there is no good and easy solution at the moment (please someone correct if I'm wrong). Basically to do things you requested you'd have to do a lot of low level programming.

    For more complex sound implemenation you can take a look at the Qt Quick DJ Turntable Example for snippets.

  4. #4
    Super Contributor
    Join Date
    Mar 2003
    Location
    Finland
    Posts
    9,556

    Re: Best practice / standard ways for cross platform sound suitable for games

    Extracted from the N-Gage SDK was the RGA (Realtime Graphics and Audio) library/APIs: http://wiki.forum.nokia.com/index.ph...duction_to_RGA

    Not sure how that'd work nowadays. At least it should be available on all S60 3rd Ed. FP1 and FP2 devices with N-Gage support. Not sure if the library/APis are available any longer, and if they ever were on S60 5th Ed. for real. (Definitely not/never on any Symbian^3 devices, nor maemo/MeeGo - at least not in any form or shape that Nokia ever published.)

    Anyway, the point is, that Nokia used to understand how to do things like this, when they still invested in games related stuff.

    Today, if you're targeting game development (and in particular multi-platform game development) on ARM devices where you can use native C/C++ code, then look into the AirPlay SDK (instead of using Qt): http://www.airplaysdk.com/ (a former division of Ideaworks3D).

  5. #5
    Regular Contributor
    Join Date
    Feb 2006
    Posts
    67

    Re: Best practice / standard ways for cross platform sound suitable for games

    Hi Guys

    Thanks for your answers. Since I would like to target the Meego device when it comes out with this project, Airplay and the N-Gage libraries won't work for me. The DJ Turntable example looks promising, I'll look into that.

    Dave

  6. #6
    Regular Contributor
    Join Date
    Feb 2006
    Posts
    67

    Re: Best practice / standard ways for cross platform sound suitable for games

    Documenting my progress for future generations - the DJ app has no delay when compiled for the desktop, but when trying it on a device (E7) there is about a half second delay on sounds (you can see it clearly in the drum machine.) Obviously this won't cut it for gaming... I'm going to look at the code and see what I can get if I break it down to the basics.

  7. #7
    Regular Contributor
    Join Date
    May 2010
    Posts
    362

    Re: Best practice / standard ways for cross platform sound suitable for games

    Yeah the half second delay is something all developers dealing with sound on Symbian are much too familiar with.

    Unfortunately I am not away of any work around for this - although games such as Angry Birds do not have such delay so there must be a way.

    EDIT: Well actually Angry Birds might be just running the physics "simulation" in some sort of buffer, therefore enabling them to play the sound in advance. This is something to consider if your game design allows it.

  8. #8
    Regular Contributor
    Join Date
    Feb 2006
    Posts
    67

    Re: Best practice / standard ways for cross platform sound suitable for games

    Quote Originally Posted by teemup View Post
    Yeah the half second delay is something all developers dealing with sound on Symbian are much too familiar with.

    Unfortunately I am not away of any work around for this - although games such as Angry Birds do not have such delay so there must be a way.

    EDIT: Well actually Angry Birds might be just running the physics "simulation" in some sort of buffer, therefore enabling them to play the sound in advance. This is something to consider if your game design allows it.
    Thanks for your reply. I had considered this but my game isn't purely physics based - like most I think. I could add this in for certain events that are completely deterministic but then it's starting to be a lot of additional complexity in the engine just for a still partially working implementation of sound effects.

  9. #9
    Regular Contributor
    Join Date
    Feb 2006
    Posts
    67

    Re: Best practice / standard ways for cross platform sound suitable for games

    It looks like the audio component of QtGameEnabler https://projects.forum.nokia.com/qtgameenabler does the basics that I'm looking for, using QAudioOutput which is the lowest latency / best suited for games of the Qt sound implementations. I think this is what the DJ Turntable example uses as well, but with some modifications to process the sound more. Based on comments on the Symbian example posted earlier, it should have the same or better latency as that Symbian native way of doing it.

    I suspect that the latency will still be too high to generate a nice effect on Symbian but this is really a limitation of the platform as others have said above and there is probably not much work around for it without getting access to undocumented APIs (I suspect this is how some games, and for example Skype, have done it - undocumented APIs to accomplish basic things seems to be a time honoured Symbian tradition).

    On the plus side this should be completely portable and may run pretty well on Meego etc and even on future or current Symbian devices depending on firmware updates / implementation.

    I'll report back when/if I actually get this running.

  10. #10
    Regular Contributor
    Join Date
    May 2010
    Posts
    362

    Re: Best practice / standard ways for cross platform sound suitable for games

    What Qt SDK version are you running?

    There is a bug report on the issue:
    http://bugreports.qt.nokia.com/browse/QTMOBILITY-855

    And it seems that there is improvement on the 1.1.1, so the one in the Release Candidate: https://www.forum.nokia.com/info/sw....f8/Qt_SDK.html should help you.
    Remember to update Qt and Mobility on the device too

Similar Threads

  1. Which platform is best for my case? Java, qt or Python?
    By erv2 in forum Mobile Java General
    Replies: 4
    Last Post: 2010-04-28, 11:26
  2. Replies: 4
    Last Post: 2010-02-25, 16:35
  3. Best practice for packing Flash Lite
    By TurfStudios in forum [Archived] Flash Lite on Nokia Devices
    Replies: 4
    Last Post: 2008-04-28, 12:40
  4. Replies: 0
    Last Post: 2004-12-10, 15:05
  5. best platform for SMS application?
    By alftom in forum General Messaging
    Replies: 2
    Last Post: 2002-08-06, 08:13

Posting Permissions

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