Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Play sound in ubuntu linux suggestion

Play sound in ubuntu linux suggestion

Scheduled Pinned Locked Moved General and Desktop
6 Posts 3 Posters 6.0k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    alexandros
    wrote on last edited by
    #1

    Hello developers :)
    QSound apparently doesn't work for linux because it requires NAS or something like this that it's not default and I don't want dependencies like this...

    So, I've seen some libraries such as QtMultimedia or QAudioOutput that look really interesting (I don't want to use phonon because it is huge and I just want to play an audio file, nothing more) but they are not available (maybe available only for mobile programming if correct?)!
    Why is this? What do you suggest me to do?
    I run this version of Qt:
    Qt 2.1.0 based on Qt 4.7.2 (32 bit)
    and, as always, thanks in advance for any answers :) :)

    1 Reply Last reply
    0
    • D Offline
      D Offline
      dangelog
      wrote on last edited by
      #2

      They ARE available even on desktop. You could just include the QtMultimedia module (QT += multimedia), but it's a much better idea to use the one available from QtMobility.

      Software Engineer
      KDAB (UK) Ltd., a KDAB Group company

      1 Reply Last reply
      0
      • D Offline
        D Offline
        dialingo
        wrote on last edited by
        #3

        Use QMediaPlayer!
        It is part of Mobility. Ubuntu users find it in package qtmobility-dev

        Mobility comes with a media player example.

        1 Reply Last reply
        0
        • A Offline
          A Offline
          alexandros
          wrote on last edited by
          #4

          Hey, thanks, I have already tried including QT += multimedia in the project file but I got
          @/usr/bin/ld: cannot find -lQtMultimedia@ so I assumed it's not available :/

          1 Reply Last reply
          0
          • D Offline
            D Offline
            dialingo
            wrote on last edited by
            #5

            Since mobility lives outside Qt the build system integration does not work reliably. It all depends on where Mobility is located.

            If you have good luck this works:
            @CONFIG += mobility
            MOBILITY = multimedia@

            If not do not despair. Simply add two includepathes (to QtMulitmediaKit and QtMobility) and a link path.

            1 Reply Last reply
            0
            • A Offline
              A Offline
              alexandros
              wrote on last edited by
              #6

              Thanks, the last one worked fine :)

              1 Reply Last reply
              0

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved