Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. QMediaPlayer issue(audio not playing after some time)
Forum Updated to NodeBB v4.3 + New Features

QMediaPlayer issue(audio not playing after some time)

Scheduled Pinned Locked Moved Unsolved Qt for Python
1 Posts 1 Posters 646 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.
  • D Offline
    D Offline
    dancaer69
    wrote on last edited by dancaer69
    #1

    I have a problem with sound in my application, in which I use QMediaplayer. I cannot reproduse the issue when I'm running the app from pycharm, but when I'm running it as normal application from command line after some time(10-15mins or more) the sound stops and never plays again. And 2-3 times I had a complet freeze. After a freeze I get an error about /usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstossaudio.so: cannot open shared object file:: to many open files.
    And the last time when sound stopped i get this error:
    (python3:22875): GStreamer-CRITICAL **: 17:18:23.046: gst_poll_wait: assertion 'set != NULL' failed
    I have some small(3-4secs) waf files which activated by click of button or when timer finishes. Here is the code I use for sound play:

        def playSound(self,sound):
            player = QtMultimedia.QMediaPlayer(self)
            s=QtMultimedia.QMediaContent(QUrl(sound))
            player.setMedia(s)
            vol=self.horizontalSlider.value()
            player.setVolume(vol)
            player.play()
    

    And I use this method in some places to load the files like this:

    self.playSound("qrc:resources/sounds/end.wav")
    

    Any ideas why this happens, and hopefully a way to fix this?

    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