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. Buffered sound (wav) distorted at end
Forum Updated to NodeBB v4.3 + New Features

Buffered sound (wav) distorted at end

Scheduled Pinned Locked Moved General and Desktop
6 Posts 2 Posters 4.3k Views 1 Watching
  • 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.
  • W Offline
    W Offline
    Wim De Backer
    wrote on last edited by
    #1

    Hi,

    Some wav files are distorted the last second when I play the file from a QByteArray. The sound plays nice when I use the file as MediaSource, but not when I first put the data in a QByteArray and pass it to the player using a QBuffer.
    I can see no obvious difference (length, filesize, bitrate, ...) between files that play normal and files that act weird.

    Example:
    Original file http://dl.dropbox.com/u/6552350/buy_one_free.wav
    This is how the distorted file sounds: http://dl.dropbox.com/u/6552350/distorted.wav

    (I'm working in Windows7)

    This 'feels like' a bug, but maybe it's just me.

    @

    QFile myFile(sndFile);
    QByteArray a;
    myFile.open(QIODevice::ReadOnly);
    a = myFile.readAll();

    myFile.close();
    QBuffer *buf = new QBuffer(this);
    buf->close();
    buf->setData(a);

    music = Phonon::createPlayer(Phonon::MusicCategory,buf); // sound distorted

    //if (!sndFile.isEmpty()) {
    //Phonon::MediaSource source(sndFile);}
    // music = Phonon::createPlayer(Phonon::MusicCategory,source); // plays nice
    music->play();
    @

    Thanks for your help!

    Wim

    1 Reply Last reply
    0
    • EddyE Offline
      EddyE Offline
      Eddy
      wrote on last edited by
      #2

      Hi Wim,

      Welcome to devnet!

      I tried your wav files and could play only the second (distorted) one.

      Qt Certified Specialist
      www.edalsolutions.be

      1 Reply Last reply
      0
      • W Offline
        W Offline
        Wim De Backer
        wrote on last edited by
        #3

        Strange,
        I can download and play it from the link above. But I found the original wav here: http://www.wavsource.com/people/men.htm -->buy one free

        Wim

        1 Reply Last reply
        0
        • EddyE Offline
          EddyE Offline
          Eddy
          wrote on last edited by
          #4

          Just the same. Could be my mobile. I will check it again tomorrow on my windows7.

          Qt Certified Specialist
          www.edalsolutions.be

          1 Reply Last reply
          0
          • W Offline
            W Offline
            Wim De Backer
            wrote on last edited by
            #5

            Thanks

            btw I have other wav's with the same problem, so that individual wav can't be the problem.
            I just converted the wav to mp3, the mp3 plays fine.
            And converted the mp3 back to wav, then the new wav is ok.

            But the problem stays the same, I can't predict wich wav's will work and wich won't.

            Wim

            1 Reply Last reply
            0
            • EddyE Offline
              EddyE Offline
              Eddy
              wrote on last edited by
              #6

              bq. Example:
              Original file http://dl.dropbox.com/u/6552350/buy_one_free.wav
              This is how the distorted file sounds: http://dl.dropbox.com/u/6552350/distorted.wav

              I tested both on windows 7 and as you said I can play them. But on iOS 4 the first couldn't be played. I know that's not a solution to your problem but could be interesting te know.

              "Did you follow the following installation instructions ? ":http://developer.qt.nokia.com/doc/qt-4.7/phonon-overview.html#id-13ad5cd8-5ffa-4fdb-b3ec-a6a0bd57e92b

              bq. On Windows, building Phonon requires DirectX and DirectShow version 9 or higher. You'll need additional SDKs you can download from Microsoft.

              "Also did you know this about Phonon":http://labs.qt.nokia.com/2011/05/12/qt-modules-maturity-level-the-list/

              bq. Overall module state: Done inside Qt, Maintained outside of Qt
              Reasoning: QtMultimediaKit recommended instead; development of Phonon continues and is maintained outside of Qt, by the KDE community.
              It could be worth a try using QtMultimediakit

              I couldn't find a similar bug in the "bugtracker :":https://bugreports.qt.nokia.com/secure/QuickSearch.jspa

              You could add your bug report if the above requirements are met.

              Qt Certified Specialist
              www.edalsolutions.be

              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