[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Discuss-gnuradio] Re: gr.wavfile_source
From: |
Martin Braun |
Subject: |
Re: [Discuss-gnuradio] Re: gr.wavfile_source |
Date: |
Thu, 18 Dec 2008 15:10:08 +0100 |
User-agent: |
Mutt/1.5.16 (2007-06-09) |
On Thu, Dec 18, 2008 at 11:25:04AM +0100, Dimitris Symeonidis wrote:
> Martin (or anyone else), I have an additional question about
> gr_wavfile_source:
>
> after opening the file (with self.src = gr.wavfile_source
> (options.filename, True)), is it possible to get some of the
> parameters and use them in the code?
>
> I'm particularly interested in d_sample_rate(1), d_nchans(1),
> d_bytes_per_sample(2)
>
> I tried self.src.d_nchans, but it tells me: AttributeError:
> 'gr_wavfile_source_sptr' object has no attribute 'd_nchans'
No, but if you check gnuradio-core/src/lib/io/gr_wavfile_source.i,
you'll see that the following methods get exported via SWIG:
unsigned int sample_rate();
int bits_per_sample();
int channels();
which return exactly what you'd expect (I hope :).
Note this is bits - and not bytes - per sample you get.
Cheers,
mb
--
Dipl.-Ing. Martin Braun Phone: +49-(0)721-608 3790
Institut fuer Nachrichtentechnik Fax: +49-(0)721-608 6071
Universitaet Karlsruhe (TH) http://www.int.uni-karlsruhe.de/
pgp7bvd4vcEjT.pgp
Description: PGP signature