diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-10-30 16:06:30 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-10-30 16:06:30 (GMT) |
commit | 4a6386b0b75f97c6d53efbeb5cd51fb4247c4c11 (patch) | |
tree | f19b0091967ea0211f45ffe23838fff40dbc9ea6 /demos/spectrum/app/utils.cpp | |
parent | 967afc717ffd411e22ce94de77cf54284815b27e (diff) | |
parent | e8c01ab0e5fb6134617a69d88ed0cbce24a33da5 (diff) | |
download | Qt-4a6386b0b75f97c6d53efbeb5cd51fb4247c4c11.zip Qt-4a6386b0b75f97c6d53efbeb5cd51fb4247c4c11.tar.gz Qt-4a6386b0b75f97c6d53efbeb5cd51fb4247c4c11.tar.bz2 |
Merge branch 4.7 into qt-master-from-4.7
Diffstat (limited to 'demos/spectrum/app/utils.cpp')
-rw-r--r-- | demos/spectrum/app/utils.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/demos/spectrum/app/utils.cpp b/demos/spectrum/app/utils.cpp index 4ead6c2..49a7626 100644 --- a/demos/spectrum/app/utils.cpp +++ b/demos/spectrum/app/utils.cpp @@ -49,8 +49,10 @@ qint64 audioDuration(const QAudioFormat &format, qint64 bytes) qint64 audioLength(const QAudioFormat &format, qint64 microSeconds) { - return (format.frequency() * format.channels() * (format.sampleSize() / 8)) + qint64 result = (format.frequency() * format.channels() * (format.sampleSize() / 8)) * microSeconds / 1000000; + result -= result % (format.channelCount() * format.sampleSize()); + return result; } qreal nyquistFrequency(const QAudioFormat &format) |