Fix a regression in WAV file writing from r6383

WAV files were written with an incorrect fomat chunk average bytes per
second field.  This only effects  a few  media players like  WMP, most
ignore this field.

git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@6405 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Bill Somerville 2016-01-19 19:06:12 +00:00
parent 676b6b8a34
commit 0f59c63ea6

View File

@ -289,7 +289,7 @@ bool BWFFile::impl::write_header (QAudioFormat format)
fmt.audio_format = qToBigEndian<quint16> (1); // PCM
fmt.num_channels = qToBigEndian<quint16> (format.channelCount ());
fmt.sample_rate = qToBigEndian<quint32> (format.sampleRate ());
fmt.byte_rate = qToBigEndian<quint32> (format.bytesForDuration (1000));
fmt.byte_rate = qToBigEndian<quint32> (format.bytesForDuration (1000000));
fmt.block_align = qToBigEndian<quint16> (format.bytesPerFrame ());
fmt.bits_per_sample = qToBigEndian<quint16> (format.sampleSize ());
desc.set ("fmt", qToBigEndian<quint32> (sizeof fmt));
@ -299,7 +299,7 @@ bool BWFFile::impl::write_header (QAudioFormat format)
fmt.audio_format = qToLittleEndian<quint16> (1); // PCM
fmt.num_channels = qToLittleEndian<quint16> (format.channelCount ());
fmt.sample_rate = qToLittleEndian<quint32> (format.sampleRate ());
fmt.byte_rate = qToLittleEndian<quint32> (format.bytesForDuration (1000));
fmt.byte_rate = qToLittleEndian<quint32> (format.bytesForDuration (1000000));
fmt.block_align = qToLittleEndian<quint16> (format.bytesPerFrame ());
fmt.bits_per_sample = qToLittleEndian<quint16> (format.sampleSize ());
desc.set ("fmt", qToLittleEndian<quint32> (sizeof fmt));