diff options
author | gmazilla <51999383+gmazilla@users.noreply.github.com> | 2019-06-19 15:54:21 +0300 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2019-06-19 08:29:19 -0700 |
commit | 0d9eda3b123884f3d5d0177908d0a30c1c9c18e9 (patch) | |
tree | d49135ca256337ca2ee6271590c56a8998724ba9 /gr-blocks/lib/wavfile.cc | |
parent | e1053e44c2ed76c94c33187c44f1562e43a5fc1d (diff) |
blocks: Fix 8-bit WAV file reading
'Wav File Source' block in gnuradio reads PCM 8bit wav files
incorrectly. It adds random huge DC component. Caused by garbage in high
byte of buf_16bit.
Diffstat (limited to 'gr-blocks/lib/wavfile.cc')
-rw-r--r-- | gr-blocks/lib/wavfile.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gr-blocks/lib/wavfile.cc b/gr-blocks/lib/wavfile.cc index b0d2e7ff96..e191f763c2 100644 --- a/gr-blocks/lib/wavfile.cc +++ b/gr-blocks/lib/wavfile.cc @@ -180,7 +180,7 @@ namespace gr { short int wav_read_sample(FILE *fp, int bytes_per_sample) { - int16_t buf_16bit; + int16_t buf_16bit = 0; if(fread(&buf_16bit, bytes_per_sample, 1, fp) != 1) { return 0; |