GNU Radio C++ API Reference g90d26cb
The Free & Open Software Radio Ecosystem
 
Loading...
Searching...
No Matches
wavfile_source.h
Go to the documentation of this file.
1/* -*- c++ -*- */
2/*
3 * Copyright 2004,2008,2013 Free Software Foundation, Inc.
4 *
5 * This file is part of GNU Radio
6 *
7 * SPDX-License-Identifier: GPL-3.0-or-later
8 *
9 */
10
11#ifndef INCLUDED_GR_WAVFILE_SOURCE_H
12#define INCLUDED_GR_WAVFILE_SOURCE_H
13
14#include <gnuradio/blocks/api.h>
15#include <gnuradio/sync_block.h>
16
17namespace gr {
18namespace blocks {
19
20/*!
21 * \brief Read samples from an audio file (uncompressed or compressed)
22 * \ingroup audio_blk
23 *
24 * \details
25 * Unless otherwise called, values are within [-1;1].
26 * Check gr_make_wavfile_source() for extra info.
27 */
28class BLOCKS_API wavfile_source : virtual public sync_block
29{
30public:
31 // gr::blocks::wavfile_source::sptr
32 typedef std::shared_ptr<wavfile_source> sptr;
33
34 static sptr make(const char* filename, bool repeat = false);
35
36 /*!
37 * \brief Read the sample rate as specified in the audio file metadata
38 */
39 virtual unsigned int sample_rate() const = 0;
40
41 /*!
42 * \brief Return the number of bits per sample as specified in
43 * the audio file metadata. Only 8 or 16 bit are supported here.
44 */
45 virtual int bits_per_sample() const = 0;
46
47 /*!
48 * \brief Return the number of channels in the audio file as
49 * specified in the audio file metadata. This is also the max number
50 * of outputs you can have.
51 */
52 virtual int channels() const = 0;
53};
54
55} /* namespace blocks */
56} /* namespace gr */
57
58#endif /* INCLUDED_GR_WAVFILE_SOURCE_H */
repeat each input repeat times
Definition repeat.h:30
Read samples from an audio file (uncompressed or compressed)
Definition wavfile_source.h:29
static sptr make(const char *filename, bool repeat=false)
virtual int channels() const =0
Return the number of channels in the audio file as specified in the audio file metadata....
std::shared_ptr< wavfile_source > sptr
Definition wavfile_source.h:32
virtual unsigned int sample_rate() const =0
Read the sample rate as specified in the audio file metadata.
virtual int bits_per_sample() const =0
Return the number of bits per sample as specified in the audio file metadata. Only 8 or 16 bit are su...
synchronous 1:1 input to output with history
Definition sync_block.h:26
#define BLOCKS_API
Definition gr-blocks/include/gnuradio/blocks/api.h:18
GNU Radio logging wrapper.
Definition basic_block.h:29