Buffered sound (wav) distorted at end
-
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
-
Hi Wim,
Welcome to devnet!
I tried your wav files and could play only the second (distorted) one.
-
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 freeWim
-
Just the same. Could be my mobile. I will check it again tomorrow on my windows7.
-
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
-
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.wavI 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 QtMultimediakitI 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.