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.

Qt Code:
  1. QFile myFile(sndFile);
  2. myFile.open(QIODevice::ReadOnly);
  3. a = myFile.readAll();
  4.  
  5. myFile.close();
  6. QBuffer *buf = new QBuffer(this);
  7. buf->close();
  8. buf->setData(a);
  9.  
  10. music = Phonon::createPlayer(Phonon::MusicCategory,buf); // sound distorted
  11.  
  12. //if (!sndFile.isEmpty()) {
  13. //Phonon::MediaSource source(sndFile);}
  14. // music = Phonon::createPlayer(Phonon::MusicCategory,source); // plays nice
  15. music->play();
To copy to clipboard, switch view to plain text mode 

Thanks for your help!

Wim