Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Phonon deployment problem - Won't play buffered mp3's

Phonon deployment problem - Won't play buffered mp3's

Scheduled Pinned Locked Moved Installation and Deployment
4 Posts 2 Posters 3.4k 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.
  • S Offline
    S Offline
    Soerenc
    wrote on last edited by
    #1

    Hi

    I have a Phonon problem, I hope somebody can help me with.

    I'm developing an application that uses phonon to play small mp3-files. The mp3's are saved in a sqlite database, and are loaded when required into an QByteArray that are played using the media object in Phonon.

    It works fine on my development machine, but when i deploy it doesnt play anything.

    Here are some details:
    *

    • Using qt and phonon build from source (using VC9).
    • I'm deploying the phonon.dll and phonon_backend/phonon_ds9.dll
    • If the QByteArray with the mp3 data are saved to a file, and the filename is passed to the mediaobject instead of the QByteArray directly, it works fine.
    • I have used ProcessMonitor and Dependency Walker to see if any DLL's are missing, but it doesn't seem so.
    • It only appears to be when loading the mediaobject from a buffer it fails to play, it plays mp3's directly from files correctly, also when deployed.

    This code plays the QByteArray:
    @QByteArray resourceData = resource.getData();
    m_audioBuffer = new QBuffer();
    m_audioBuffer->setData(resourceData);
    m_mediaObject->stop();
    m_mediaObject->clearQueue();
    m_mediaObject->setCurrentSource(Phonon::MediaSource(m_audioBuffer));
    m_mediaObject->play();@

    It works when I'm developing, byt when installing on the same machine it doesn't work.
    If the QByteArray is saved to a file and played using:

    @m_mediaObject->stop();
    m_mediaObject->clearQueue();
    m_mediaObject->setCurrentSource(Phonon::MediaSource(filename));
    m_mediaObject->play();@

    Any ideas why it won't play from the QBuffer?

    1 Reply Last reply
    0
    • B Offline
      B Offline
      blex
      wrote on last edited by
      #2

      Try to save audio buffer to file and compare the file content with the original one. Maybe it will help to localize the problem.


      Oleksiy Balabay

      1 Reply Last reply
      0
      • S Offline
        S Offline
        Soerenc
        wrote on last edited by
        #3

        Ok, I'll try that. But when I save the stream to a file, it works ok, so it seems to be valid data.

        And just another detail:

        • When i try to play from the buffer, the media object changes state from loading to playing, but never changes state again, not even to the error state, and the errorString() function dosn't return any error.
        1 Reply Last reply
        0
        • B Offline
          B Offline
          blex
          wrote on last edited by
          #4

          Strange. Cannot advice anything clever than to use workaround saving to temporary file.


          Oleksiy Balabay

          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