gnuradio.blocks: Audio Signals

gnuradio.blocks.wavfile_sink(char filename, int n_channels, unsigned int sample_rate, int bits_per_sample = 16) → sptr

Write stream to a Microsoft PCM (.wav) file.

Values must be floats within [-1;1]. Check gr_make_wavfile_sink() for extra info.

Constructor Specific Documentation:

Parameters:
  • filename
  • n_channels
  • sample_rate
  • bits_per_sample
wavfile_sink_sptr.active_thread_priority(self) → int
wavfile_sink_sptr.close(self)

Closes the currently active file and completes the WAV header. Thread-safe.

wavfile_sink_sptr.open(self, char filename) → bool

Opens a new file and writes a WAV header. Thread-safe.

wavfile_sink_sptr.set_bits_per_sample(self, int bits_per_sample)

Set bits per sample. This will not affect the WAV file currently opened (see set_sample_rate()). If the value is neither 8 nor 16, the call is ignored and the current value is kept.

wavfile_sink_sptr.set_sample_rate(self, unsigned int sample_rate)

Set the sample rate. This will not affect the WAV file currently opened. Any following open() calls will use this new sample rate.

wavfile_sink_sptr.set_thread_priority(self, int priority) → int
wavfile_sink_sptr.thread_priority(self) → int
gnuradio.blocks.wavfile_source(char filename, bool repeat = False) → sptr

Read stream from a Microsoft PCM (.wav) file, output floats.

Unless otherwise called, values are within [-1;1]. Check gr_make_wavfile_source() for extra info.

Constructor Specific Documentation:

Parameters:
  • filename
  • repeat
wavfile_source_sptr.active_thread_priority(self) → int
wavfile_source_sptr.bits_per_sample(self) → int

Return the number of bits per sample as specified in the wav file header. Only 8 or 16 bit are supported here.

wavfile_source_sptr.channels(self) → int

Return the number of channels in the wav file as specified in the wav file header. This is also the max number of outputs you can have.

wavfile_source_sptr.sample_rate(self) → unsigned int

Read the sample rate as specified in the wav file header.

wavfile_source_sptr.set_thread_priority(self, int priority) → int
wavfile_source_sptr.thread_priority(self) → int

Previous topic

gnuradio.blocks: Modulators and Demodulators

Next topic

gnuradio.blocks: Netwroking Tools

This Page