From 18f64ba685cfc2533e2d7726aa43c524b007d97b Mon Sep 17 00:00:00 2001
From: Ron Economos <w6rz@comcast.net>
Date: Tue, 23 Jun 2020 14:40:40 -0700
Subject: gr-blocks: Transition the WAV sink and source blocks to libsndfile.
 Compressed input and output with FLAC and Ogg Vorbis now supported.

---
 gr-blocks/lib/wavfile_source_impl.h | 15 ++++-----------
 1 file changed, 4 insertions(+), 11 deletions(-)

(limited to 'gr-blocks/lib/wavfile_source_impl.h')

diff --git a/gr-blocks/lib/wavfile_source_impl.h b/gr-blocks/lib/wavfile_source_impl.h
index 8504413fec..9554feab67 100644
--- a/gr-blocks/lib/wavfile_source_impl.h
+++ b/gr-blocks/lib/wavfile_source_impl.h
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2004,2008,2013 Free Software Foundation, Inc.
+ * Copyright 2004,2008,2013,2020 Free Software Foundation, Inc.
  *
  * This file is part of GNU Radio
  *
@@ -13,7 +13,7 @@
 
 #include <gnuradio/blocks/wavfile.h>
 #include <gnuradio/blocks/wavfile_source.h>
-#include <cstdio> // for FILE
+#include <sndfile.h> // for SNDFILE
 
 namespace gr {
 namespace blocks {
@@ -21,18 +21,11 @@ namespace blocks {
 class wavfile_source_impl : public wavfile_source
 {
 private:
-    FILE* d_fp;
+    SNDFILE* d_fp;
     bool d_repeat;
 
     wav_header_info d_h;
-    unsigned d_sample_idx;
-    int d_normalize_shift;
-    int d_normalize_fac;
-
-    /*!
-     * \brief Convert an integer sample value to a float value within [-1;1]
-     */
-    float convert_to_float(short int sample);
+    long long d_sample_idx;
 
 public:
     wavfile_source_impl(const char* filename, bool repeat);
-- 
cgit v1.2.3