Ejemplo n.º 1
0
// SetSampleRate sets the sample rate for the device, also selects the
// baseband filters according to the requested sample rate for tuners
// where this is possible.
// possible values are:
// 		    225001 - 300000 Hz
// 		    900001 - 3200000 Hz
//		    sample loss is to be expected for rates > 2400000
func (dev *Radio) SetSampleRate(rate uint32) error {
	retval := C.rtlsdr_set_sample_rate(dev.devptr, C.uint32_t(rate))

	if retval != 0 {
		return fmt.Errorf("rtlsdr_set_sample_rate returned error value: %d", retval)
	}
	return nil
}
Ejemplo n.º 2
0
// Selects the baseband filters according to the requested sample rate.
//
// int rtlsdr_set_sample_rate(rtlsdr_dev_t *dev, uint32_t rate);
// rtlsdr_set_sample_rate returns 0 on success
func (c *Context) SetSampleRate(rate int) (err int) {
	return int(C.rtlsdr_set_sample_rate((*C.rtlsdr_dev_t)(c.dev),
		C.uint32_t(rate)))
}
Ejemplo n.º 3
0
// SetSampleRate sets the sample rate.
//
// When applicable, the baseband filters are also selected based
// on the requested sample rate.
func (dev *Context) SetSampleRate(rateHz int) (err error) {
	i := int(C.rtlsdr_set_sample_rate((*C.rtlsdr_dev_t)(dev),
		C.uint32_t(rateHz)))
	return libError(i)

}